How to know Modbus Slave is still receiving values

Hi All,

Is there any way to check that Modbus Slave is receiving values? I have a Modbus Slave running in my machine, which will be always active. Modbus master is connecting to it and writing values. How do I know if Modbus Master has stopped writing to my slave? Is there any way to check it other than pinging to modbus master? As Modbus Slave will always have the last written values I am not able to know when Master stops writing.

Thanks in Advance
Raji
 
Some Modbus slaves implement a timeout, or fail-safe, feature whereby the slave monitors communications from the master. The slave starts a supervisory timer once it has received a Modbus request from a master. If the supervisory timer expires before a new request is received, a timeout event occurs and the slave may indicate this event in some way or may be able to set its register values to predeterimined fail-safe values.

Another commonly used approach is to use a "heartbeat" value that the master writes to one of the slave's registers. For example, the master may toggle a register value between 0 and 1 every second. If the value is no longer changing, then you know the slave is no longer receiving values from the master.
 
Use the 'heatbeat theory'
It applies to any communication link - it's working but how do I know it's working ?!
For modbus the master utilises a spare bit from a spare register, then pulses on/off at
a frequency to suit the situation - say on 1sec / off 1sec for slow speed applications.
This register is then transmitted to the slave.
The slave merely mirrors it back again.
Logic in both the master and slave can be set up to detect the lack of change of this
'heartbeat', and alarm accordingly.

I used this successfully where a pump was energised from one PLC and high pressure (trip)
switch wired to another. The heatbeat was rapid and could trip the pump at just under 100ms
on loss of cummunications.
 
When I want to be sure that both the master and slave communicate with each other, I use counters from 1-100. The master sends its counter value to the slave, the slave adds 1 to it and the master reads that back. If it was increased by the slave, the master knows the slave is still running. And the slave can also see the the master is still incrementing the counter. This way you can give warnings to the user near the master and slave whether the communication is up and running.
 
Top