As I am busy with projects that contain many modbus RTU remote IO’s i was wondering if someone knows the best practices to do the modbus communication check in PLC program. I would like to implement a fallback to the devices if modbus fault occurs and there is no communication with with one of nodes? i would apprecieate if someone can give me some advice.
As somebody has mention before, the way to monitor if a slave is alive or not is via the properties of the instance created with the Modbus configurator.
Any slave you declare is a instance of type “ModbusSlaveComPort”
Output variable “xError” will become TRUE when communication fails. if you left “Auto-restart communication” check box unchecked, in the Mosbus Master (client)
then you can get the slave back at the poling loop by programming issuing a rise edge at “xAcknowledge” input variable of the corresponding Slave (Server), doing it in ST language may be as simple as following
We used this trick in a project where we may have variable number of slaves and we just want to run time just get into the pooling cycle just some of then.