Query the Number of alarms on the Device
The possible alarm levels of the Device are shown in the table below:
Status | Value | Description |
---|---|---|
DEVICE_WARNING_LEVEL_WARNING | 0x00 | Warning |
DEVICE_WARNING_LEVEL_ERROR | 0x01 | Error |
DEVICE_WARNING_LEVEL_FAULT | 0x02 | Fault |
DEVICE_WARNING_LEVEL_OFFLINE | 0x03 | Offline |
Distinguish from the severity of alarms: DEVICE_WARNING_LEVEL_WARNING < DEVICE_WARNING_LEVEL_ERROR < DEVICE_WARNING_LEVEL_FAULT.
Parameter | Description | Required |
---|---|---|
action | queryDeviceWarningCount | True |
pn | Datalogger number | True |
devcode | Device protocol code | True |
devaddr | Device address (485 bus) | True |
sn | Device serial number | True |
level | Alarm level, If this parameter is not passed, it indicates that you do not care | False |
handle | Has it been processed, true? Processed: Not processed, If this parameter is not passed, it indicates that you do not care | False |
sdate | Starting time (device time zone), format: yyyy-mm-dd hh:mi:ss, If this parameter is not passed, it indicates that you do not care | False |
edate | Both sdate and edate must exist simultaneously. When querying, use a semi open interval, which means sdate <= date < edate | False |
response:
Parameter | Description | Required |
---|---|---|
count | Number of unprocessed alarms | True |
{
"err":0,
"desc":"ERR_NONE",
"dat":{
"count": 0
}
}
Possible errors:
Response error code | Description | Details |
---|---|---|
0x0006 | ERR_FORMAT_ERROR | Parameter error |
0x0007 | ERR_MISSING_PARAMETER | Missing necessary parameters |
0x0102 | ERR_NOT_FOUND_DEVICE | Device not found |
0x0108 | ERR_NOT_FOUND_DEVICE_WARNING | Device alarm not found |