Author Topic: Communications Watchdog  (Read 7569 times)

Joel Moore

  • Full Member
  • Posts: 128
    • View Profile
Communications Watchdog
« on: July 26, 2006, 01:03:38 PM »
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:
Quote
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?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:Communications Watchdog
« Reply #1 on: July 26, 2006, 03:02:50 PM »
You may want to change the {dCusF} to {CusFn} (i.e. non differentiated version). A differentiated CF only work once when it has been turned from OFF to ON. So in your program, if "WatchDog"  is already ON it will not execute the "ResetWdog" function. Changing it to non differentiated guarantee that it will run once and it will then clear the "WatchDog" relay, which in effect still only execute the "ResetWdog" function once only.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Joel Moore

  • Full Member
  • Posts: 128
    • View Profile
Re:Communications Watchdog
« Reply #2 on: July 26, 2006, 07:40:25 PM »
So far so good.  Since applying your suggestion it's been running without the watchdog tripping when before it wouldn't last 30 minutes.  I'll leave it overnight but I think you've saved me a ton of grief.  Thank you very much.