# MTCMSMessage Structure

These methods allows building CMS messages to be used in communications with MagTek CMS devices.

#### CreateMTCMSMessage <a href="#id-5.1_createmtcmsmessage" id="id-5.1_createmtcmsmessage"></a>

This constructor method builds an MTCMSMessage instance with the provided values.

```
MTCMS_API MTCMSMessage* CreateMTCMSMessage( 
int messageType,
int applicationID, 
int commandID,
int dataTag,
const unsigned char* data, 
int dataLength);
```

Parameters:

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">messageType</td><td valign="top">MessageType value</td></tr><tr><td valign="top">applicationID</td><td valign="top">ApplicationID value</td></tr><tr><td valign="top">commandID</td><td valign="top">CommandID value</td></tr><tr><td valign="top">dataTag</td><td valign="top">Data tag value</td></tr><tr><td valign="top">data</td><td valign="top">Data value</td></tr><tr><td valign="top">dataLength</td><td valign="top">Length of data value</td></tr></tbody></table>

Return Value: MTCMSMessage structure

#### CreateMTCMSMessageFromBytes <a href="#id-5.2_createmtcmsmessagefrombytes" id="id-5.2_createmtcmsmessagefrombytes"></a>

This constructor method builds an MTCMSMessage instance with the provided values.

```
MTCMS_API MTCMSMessage* CreateMTCMSMessageFromBytes( 
const unsigned char* messageBytes,
int messageBytesLength);
```

Parameters:

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">messageBytes</td><td valign="top">Message in byte array value</td></tr><tr><td valign="top">messageBytesLength</td><td valign="top">Length of message bytes value</td></tr></tbody></table>

Return Value: MTCMSMessage structure

#### CreateMTCMSRequestMessage <a href="#id-5.3_createmtcmsrequestmessage" id="id-5.3_createmtcmsrequestmessage"></a>

This constructor method builds an MTCMSMessage instance with the provided values.

```
MTCMS_API MTCMSMessage* MTCMSMessage( 
int applicationID,
int commandID,
int dataTag,
const unsigned char* data, 
int dataLength);
```

Parameters:

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">applicationID</td><td valign="top">ApplicationID value</td></tr><tr><td valign="top">commandID</td><td valign="top">CommandID value</td></tr><tr><td valign="top">dataTag</td><td valign="top">Data tag value</td></tr><tr><td valign="top">data</td><td valign="top">Data value</td></tr><tr><td valign="top">dataLength</td><td valign="top">Length of data value</td></tr></tbody></table>

Return Value: MTCMSMessage structure

#### ReleaseMTCMSRequestMessage <a href="#id-5.4_releasemtcmsrequestmessage" id="id-5.4_releasemtcmsrequestmessage"></a>

This method releases the resource allocated by calls to CreateMTCMSMessage and CreateMTCMSRequestMessage methods.

```
MTCMS_API void ReleaseMTCMSMessage(MTCMSMessage* message);
```

Parameters:

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Parameter</td><td valign="top">Description</td></tr><tr><td valign="top">message</td><td valign="top">MTCMSMessage to deallocate.</td></tr></tbody></table>

Return Value: None


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.magtek.com/hardware/oem-readers-and-components/oem-readers/odynamo/documentation/programmers-manuals/common-message-structure-mtcms-programmers-reference-manual-c++/mtcmsmessage-structure.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
