# GetSysByte

### double GetSysByte(int lMsgId)

호스트(Host)로부터 수신한 SECS 메시지 헤더에 포함된 System Byte를 반환합니다. 수신된 메시지(`lMsgId`)가 어떤 고유 번호를 가지고 있는지 확인하여 로그 기록이나 메시지 매칭에 사용합니다.

Parameters

<table data-header-hidden><thead><tr><th width="185" valign="top"></th><th width="107" 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></tbody></table>

Return Value

<table data-header-hidden><thead><tr><th width="171" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Value</td><td valign="top">Description</td></tr><tr><td valign="top">>=0</td><td valign="top">수신한 SECS Message의 System Byte</td></tr><tr><td valign="top">&#x3C;0</td><td valign="top">실패 (Error Code 반환) Error Code는 Error Code List를 참조</td></tr></tbody></table>

```csharp
// 1. 수신한 메시지의 System Byte를 가져옵니다. (반환형 double 주의)
    double dSysByte = m_gem.GetSysByte(lMsgId);

    if (dSysByte >= 0)
    {
        // 2. 16진수 8자리 포맷으로 변환 (로그 대조용)
        uint realSystemByte = (uint)dSysByte;
        string hexSystemByte = realSystemByte.ToString("X8");

        Console.WriteLine($"[메시지 수신] ID: {lMsgId}, SystemByte: 0x{hexSystemByte}");
    }
    else
    {
        Console.WriteLine($"System Byte를 읽을 수 없습니다. 에러 코드: {dSysByte}");
    }
```


---

# 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/item-parsing/getsysbyte.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.
