| date | desc |
|---|---|
| 12 Apr 2019 | Initial |
This data is taken from source file icon.libServices.AlarmBits.cs
AlarmState is a 64-bit signed value (C# long, MySQL BIGINT) found in
database tables sensor_device, sensor_event and sensor_alarm (Flags).
The AlarmState value is a collection of bit flags that describe current alarm status for all I/O channels of the given device.
The nybbles of the least significant byte contains CH1 and CH2 information. Bit pairs in the next three bytes cover channels 3-14. The remaining single bit values cover channels 15-40. (TBD)
{byte 7} {byte 6} {byte 5} {byte 4} eeddccbb aa998877 66554433 22221111
7 6 5 4 3 2 1 0
{byte 4} = alarm bits for channels 15-22 going from right to left
{byte 5} = alarm bits for channels 23-30 going from right to left
{byte 6} = alarm bits for channels 31-38 going from right to left
{byte 7} = alarm bits for channels 39-40 going from right to left, remaining bits reserved
This is more or less reflected in the database schema. Channels 1 and 2 are decimal values, channels 3-14 are short integers, and channels 15-40 are bit values only (ON or OFF).
The low alarm bit values are used when channels 1-14 are contact closures.
| name | value |
|---|---|
| LOW_ALARM_1 | 0x0001 |
| HIGH_ALARM_1 | 0x0002 |
| ALARM_1_BITS | 0x0003 |
| LOW_ALARM_RESET_1 | 0x0004 |
| HIGH_ALARM_RESET_1 | 0x0008 |
| LOW_ALARM_2 | 0x0010 |
| HIGH_ALARM_2 | 0x0020 |
| ALARM_2_BITS | 0x0030 |
| LOW_ALARM_RESET_2 | 0x0040 |
| HIGH_ALARM_RESET_2 | 0x0080 |
| LOW_ALARM_3 | 0x0100 |
| HIGH_ALARM_3 | 0x0200 |
| ALARM_3_BITS | 0x0300 |
| LOW_ALARM_4 | 0x0400 |
| HIGH_ALARM_4 | 0x0800 |
| ALARM_4_BITS | 0x0C00 |
| ... | ... |
Internal Note: This data is taken from source file icon.libServices.AlarmBits.cs
2018-2022 ICON Voice Networks