Trevor J Posted June 23, 2020 Report Posted June 23, 2020 Is there a system integer or bit that is set when a Modbus RTU SLAVE has received a command from a master? I would like the make a watchdog on my slave device to to notify the operator if communications is lost and to pause the process as it is working with stale data.
AlexUT Posted June 23, 2020 Report Posted June 23, 2020 See SDW 37 description. And SI 274, 275, 276.
MVP 2023 Ausman Posted June 24, 2020 MVP 2023 Report Posted June 24, 2020 In crucial operations I have a deliberate time check on data being updated correctly. Every nominated time period, I place a number well outside the normal range in a register, having the system ignore it for that small time, and then see if it gets changed. If it doesn't get changed within a given delay, the alerts come up. This is actually a very easy thing to implement as you only need to check one piece of data, not a full vector, and isn't based on any reads of system stuff that Alex has rightly suggested. It is based on actual results. You could do it to an entire vector if you felt it needed...I've never found it necessary. I should mention that all my slaves are routinely called in a varying sequence, with a given maximum time between calls, which you definitely have to relate to the slave's checking time periods. cheers, Aus
Trevor J Posted June 24, 2020 Author Report Posted June 24, 2020 12 hours ago, AlexUT said: See SDW 37 description. And SI 274, 275, 276. SDW 37 was just what I wanted. I simply check if it hasn't changed and allow the watchdog to run, every change will reset the counter. 4 hours ago, Ausman said: In crucial operations I have a deliberate time check on data being updated correctly. Every nominated time period, I place a number well outside the normal range in a register, having the system ignore it for that small time, and then see if it gets changed. If it doesn't get changed within a given delay, the alerts come up. This is actually a very easy thing to implement as you only need to check one piece of data, not a full vector, and isn't based on any reads of system stuff that Alex has rightly suggested. It is based on actual results. You could do it to an entire vector if you felt it needed...I've never found it necessary. I should mention that all my slaves are routinely called in a varying sequence, with a given maximum time between calls, which you definitely have to relate to the slave's checking time periods. cheers, Aus I do a similar thing on the master to guarantee sane data or generate errors. The slaves though I was using a "heartbeat bit" but SWD 37 is essentially that and simpler.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now