# SendMsgEx

### int SendMsgEx(int lMsgId, int nTransactionID)

사용자가 구성한 SECS 메시지를 전송할 때, 개발자가 임의로 지정한 Transaction ID를 부여합니다. 전송 직후 GetSysByteEx(nTransactionID)를 호출하면, 해당 메시지에 실제 할당된 System Byte(메시지 고유 번호)를 확인할 수 있어 로그 분석 및 메시지 추적에 매우 용이합니다.

{% hint style="warning" %}
GetSysByteEx() 는 반드시 사용자가 먼저 보내는 Message에 대한 Systembyte만 얻을 수 있습니다.
{% endhint %}

Parameters

<table data-header-hidden><thead><tr><th width="167" valign="top"></th><th width="92" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Name</td><td valign="top">Type</td><td valign="top">Description</td></tr><tr><td valign="top">lMsgId</td><td valign="top">int</td><td valign="top">전송할 Message의 ID</td></tr><tr><td valign="top">nTransactionID</td><td valign="top">int</td><td valign="top">Message에 부여할 Transaction ID</td></tr></tbody></table>

다음은 S2F25W 를 SendMsgEx()를 이용하여 Host에게 보낸 후 SystemByte를 얻는 과정입니다.

```csharp
int MyTransactionID = 777;    //고유 TransactionID를 설정합니다.
int lMsgId = m_gem.CreateMsg(2, 25,1);
m_gem.SendMsgEx(lMsgId, MyTransactionID); //고유 TransactionID를 넣고 Msg를 보냅니다.

double nSystemByte = m_gem.GetSysByteEx(MyTransactionID);    //해당 ID로 SystemByte를 얻습니다
```


---

# 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 dynamically by asking a question.

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

```
GET https://nviasoft.gitbook.io/nviasoft-docs/api-reference/undefined-4/sendmsgex.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.
