Query device status
The possible states of the Device are shown in the table below:
Status | Value(HEX) | Description |
---|---|---|
DEVICE_STATUS_ONLINE | 0x00 | Online, normal operation |
DEVICE_STATUS_OFFLINE | 0x01 | Offline, either the Datalogger attached to the Device is offline, or the Device itself is offline (the Datalogger cannot obtain data from the Device) |
DEVICE_STATUS_FAULT | 0x02 | Fault, the Device has a fault level alarm or some registers or fields indicate that the Device is running in a fault state |
DEVICE_STATUS_STANDBY | 0x03 | Standby, some registers or fields indicate that the Device is running in standby mode |
DEVICE_STATUS_WARNING | 0x04 | Alarm, the Device has experienced a warning level alarm or some registers or fields indicate that the device is running in an alarm state |
DEVICE_STATUS_ERROR | 0x05 | Error, the Device has encountered an error level alarm or some registers or fields indicate that the Device is running in an error state |
DEVICE_STATUS_PROTOCOL_ERROR | 0x06 | Protocol error, the message collected by the Datalogger from the Device does not match the protocol |
Parameter | Description | Required |
---|---|---|
action | queryDeviceStatus | True |
device | Datalogger number, Device protocol code, Device address (485 bus), Device serial number(pn,devcode,devaddr,sn), multiple numbers separated by ';', up to 256 at a time | True |
response:
Parameter | Description | Required |
---|---|---|
device[x].pn | Datalogger number | True |
device[x].devcode | Device protocol code | True |
device[x].devaddr | Device address (485 bus) | True |
device[x].sn | Device serial number | True |
device[x].status | Device status | True |
It should be noted that interfaces fail quickly: that is, if a Device information is considered to be malformed, the interface will immediately return an error Additionally, the order of returned devices may differ from the order passed during the query
{
"err":0,
"desc":"ERR_NONE",
"dat":{
"device":[
{
"pn":"COLLECTOR0001",
"devcode":512,
"devaddr":1,
"sn":"687489900018",
"status":1
},
{
"pn":"COLLECTOR0002",
"devcode":512,
"devaddr":2,
"sn":"687489900019",
"status":0
}
]
}
}
Possible errors:
Response error code | Description | Details |
---|---|---|
0x0006 | ERR_FORMAT_ERROR | Parameter error |
0x0007 | ERR_MISSING_PARAMETER | Missing necessary parameters |
0x000D | ERR_OVER_LIMIT | EXCEEDS LIMIT |
0x000C | ERR_NO_RECORD | No record (the Device has no data) |
0x0102 | ERR_NOT_FOUND_DEVICE | Device not found |