> For the complete documentation index, see [llms.txt](https://developer.magtek.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.magtek.com/products/oem-readers-and-components/oem-readers/odynamo/documentation/programmers-manuals/common-message-structure-mtcms-programmers-reference-manual-c++/mtcmsmessage-structure.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
