modbus_get_error(signal_name)
Returns the current error state of the signal.
>>> modbus_get_error("output1")
Parameters
signal_name:
A string equal to the name of the signal. The signal name can not be empty.
error_source:
Selects the type of the returned error. Integer, 0 = combined, 1 = device error, 2 = connection error (Optional, default is 0 = combined)
Return Value
32 bit integer
0 = No error, Device errors
1 = Device error - illegal function code
2 = Device error - illegal data access
3 = Device error - illegal data value
4 = Device error - server failure
5 = Device error - acknowledge exception
6 = Device error - server busy
10 = Device error - gateway problem
11 = Device error - gateway target failure
Connection errors
Values from 1-113, see details in https://en.wikipedia.org/wiki/Errno.h and https://www.ibm.com/docs/en/db2/11.5?topic=message-tcpip-errors
If combined errors are requested, then the returned value's upper 2 bytes will store the connection error, the lower 2 bytes will store the device errors. Example returned value: 0xFFFE0004 (dec:-131068) -> upper 0xFFFE = -2 Disconnected ; lower 0x0004 = Device error - server failure
Example command: modbus_get_error("output1")
- Example Parameters:
- Signal name = output1