Hi all, i'm using a cRIO as a modbus I/O slave (serial) to control some devices and sensors. I would like to implement a watchdog.
The watchdog will expire if there's no communication with the master for 20 secs, which will then reset the I/O to their default values.
I had a look at the slave modbus I/O addressing table:
Data Item |
Data Type |
Modbus |
Modbus Slave |
Description |
|
Read |
Write |
Read |
Write |
|
|
|
|
|
|
|
|
CommFail |
Boolean value |
Yes |
No |
Yes |
No |
Represents a signal the Modbus I/O server generates. The signal is TRUE in the following cases:
- Errors occur when the Shared Variable Enginefails to communicate with a Modbus device.
- Errors occur on the serial ports or Ethernet interface of a Modbus Slave I/O server.
|
ErrorStatus |
32-bit signed integer |
N/A |
N/A |
Yes |
No |
Represents the error status of the Modbus Slave I/O server. If CommFail is FALSE, this data item is 0. IfCommFail is TRUE, this data item returns an error code.
|
Updating |
Boolean value |
Yes |
No |
Yes |
No |
Represents a signal the Modbus or Modbus Slave I/O server generates. The signal is TRUE while the Modbus I/O server polls a Modbus device or the Modbus Slave I/O server is being updated. |
I created bound variables for the above. The variables work fine on the master modbus I/O. But it's always connected (CommFail = "F"), even when i unplug the serial cable.
And strangely, Updating is always "F" on the slave modbus, even when the values are being updated.