# AddU4Item\[]

#### int AddU4Item(int lMsgId, uint\[] pnValue)

메시지 작성시 U4 데이터를 원하는 길이만큼 추가 해 주는 함수.

Parameters

<table data-header-hidden><thead><tr><th valign="top"></th><th 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">작성 중인 메시지의 고유 ID</td></tr><tr><td valign="top">pnValue</td><td valign="top">uint[]</td><td valign="top">참조할 U4 데이터의 시작 주소</td></tr></tbody></table>

```csharp
// 케이스 2: U4 배열 데이터 추가 (예: 장비 내 여러 센서의 누적 카운트)
    uint[] uCounts = new uint[] { 100000, 2000000, 4000000000 };
    int nResult2 = m_gem.AddU4Item(lMsgId, uCounts);

    if (nResult2 == 0)
    {
        Console.WriteLine("U4 배열 아이템 추가 성공");
    }
    else
    {
        // 실패 시 반환 코드 확인
        Console.WriteLine($"아이템 추가 실패. 반환 코드: {nResult2}");
    }
```


---

# 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/addu4item/addu4item-1.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.
