# GetAlarmCode

#### int GetAlarmCode(int ALID)

EZGemPlus에 등록된 ALID의 ALCD(Alarm Code)를 반환 해 줌.

Parameters

<table data-header-hidden><thead><tr><th width="189" valign="top"></th><th width="150" 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">ALID</td><td valign="top">int</td><td valign="top">ALCD를 반환 받기 원하는 ALID</td></tr></tbody></table>

```csharp
//알람을 발생시킬때
int nALID = Convert.ToInt32(strAlarmId);
short nAlcd = (short)m_gem.GetAlarmCode(nALID);
nAlcd += 0x80;
m_gem.SendAlarmReport(nALID, nAlcd);

//알람을 해제시킬때
 int nALID = Convert.ToInt32(strAlarmId);
 short nAlcd = (short)m_gem.GetAlarmCode(nALID);
 m_gem.SendAlarmReport(nALID, 0);
```

```log
11:10:55(007) , [HSMS:OUT   ]  00 00 85 01 00 00 00 00 00 05 01 03 21 01 81 B1 04 00 00 0F A3 41 0A 34 30 30 33 5F 41 4C 41 52 4D 
11:10:55(007) , [SECS-II:OUT]  S5F1, DeviceID=0, WBit=1, SystemByte=00000005, TotalLength=33, MsgQue=1
		<S5F1W
		   <L[3/1]
		      <B[1/1] 0x81>		//알람발생
		      <U4[1/1] 4003>
		      <A[10/1] '4003_ALARM'>
		   >
		>
11:10:55(023) , [EZNET:EVENT]  [Callback Event] -> EventID=412, param=65541
11:10:55(055) , [EZNET:EVENT]  [Callback Event] -> EventID=402, param=5001
11:10:55(075) , [HSMS:IN    ]  00 00 05 02 00 00 00 00 00 05 21 01 00 
11:10:55(079) , [SECS-II:IN ]  S5F2, DeviceID=0, WBit=0, SystemByte=00000005, TotalLength=13, MsgQue=1
		<S5F2
		   <B[1/1] 0x00>   /* ACKC5 */
		>
11:10:55(103) , [EZNET:EVENT]  [Callback Event] -> EventID=411, param=65542
11:10:55(119) , [EZNET:EVENT]  [Callback Event] -> EventID=401, param=5002
11:11:07(445) , [HSMS:OUT   ]  00 00 85 01 00 00 00 00 00 07 01 03 21 01 01 B1 04 00 00 0F A3 41 0A 34 30 30 33 5F 41 4C 41 52 4D 
11:11:07(445) , [SECS-II:OUT]  S5F1, DeviceID=0, WBit=1, SystemByte=00000007, TotalLength=33, MsgQue=1
		<S5F1W
		   <L[3/1]
		      <B[1/1] 0x01>		//알람해제
		      <U4[1/1] 4003>
		      <A[10/1] '4003_ALARM'>
		   >
		>
11:11:07(468) , [EZNET:EVENT]  [Callback Event] -> EventID=412, param=65543
11:11:07(479) , [EZNET:EVENT]  [Callback Event] -> EventID=402, param=5001
11:11:07(487) , [HSMS:IN    ]  00 00 05 02 00 00 00 00 00 07 21 01 00 
11:11:07(500) , [SECS-II:IN ]  S5F2, DeviceID=0, WBit=0, SystemByte=00000007, TotalLength=13, MsgQue=1
		<S5F2
		   <B[1/1] 0x00>   /* ACKC5 */
		>
```


---

# 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/alarm/getalarmcode.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.
