Has anyone successfully implemented a communications watchdog using ladder logic? I'm trying to ensure that our PLC isn't able to do anything it shouldn't if our HMI loses communications with it.
What I do now is the following:
The ResetWDog CusF contains:
TIMERPV[1] = 50
TIMERBIT[1] = 0
CLRIO WatchDog
From our HMI we repeatedly set the WatchDog relay using "Force Set/Clear Single I/O Bit" command ("Wbnnnnxx"). This causes the ResetWDog custom function to be called which resets the timer and clears the WatchDog relay. This timer is constantly counting down thanks to the Norm.On input. If the timer counts down to "0" the WDExpired custom function gets called which performs the appropriate actions (currently resetting the PLC which puts it in a "frozen" startup state).
This works 95% of the time but once in a while the timer inexplicably expires. Monitoring my HMI doesn't reveal any obvious communication delays. The timer is currently set to 5 seconds and the HMI is probably resetting the WatchDog relay 10 times a second.
So maybe I'm going about this all wrong. Has anyone else tried to achieve a similar goal following a different path?