Electrical & Software Control Systems for 
Safe Rides & Shows
(407) 290-2000

Watchdog

There are many applications where you need to know if a connection to a remote device is intact and/or that the remote device is functioning.

You can usually detect the failure of the link or the remote device by sending a alternating signal to the remote device and back, then looking at the return signal. If the return signal should stop alternating, either in the 0 or 1 state, either the link or the device which reflects the signal may be bad. When this occurs, your PLC can report a fault message, ignore the inputs from the remote device, disable the affected device or whatever other action is appropriate. Here is a simple implementation of a watchdog circuit in PLC logic:
Figure 1 - Master PLC Watchdog Driver and Detector
The watchdog signal returning from the remote (slave) device is inverted by the N/C -|/|- contact and sent back to the remote device. The remote device returns the unchanged signal immediately to be inverted again. This constant inversion causes the watchdog signal to oscillate between 0 and 1 at high speed, limited only by the scan rate of the PLC(s) and the response time of the link. The TON and TOF instructions detect if the oscillating signal ever stops in either the 1 or 0 states respectively. Choose the time-outs to reflect the worst case round trip speed of the link and scan times. The Done (DN) bits from the two timers are ANDed together to determine if the link and device is still running. The DOG_OK bit is not latched but may be latched for an alarm and acknowledgment. Either the unlatched or latched version can be used to qualify inputs from the remote device, disable the device, Emergency Stop the system or other appropriate action. If the unlatched bit is used the system will recover immediately when the link is restored; the latched version will require an operator acknowledgment.
Figure 2 - Remote Device Loopback
The slave device merely has to return the watchdog signal. Note that the symbols in the Slave PLC may not match those in the Master. I’ve used the same symbols here to make the relationship clear. If the slave device is also a PLC, it can also use the TON and TOF instructions and the DOG_OK rung to check the link for its purposes. However, only the master should use the N/C contact to invert the watchdog signal.

Figure 3 - Single Timer, Dual Edge Detector
The single timer variation detects both the rising and falling edge of the watchdog signal by comparing it to the last output (prior to inverting the output again). As long as the signal continues to rise and fall more frequently than the time-out of the TOF, the TOF will receive a periodic pulse, keeping the Done bit of the TOF high and satisfying the OK bit. This test is unfortunately sensitive to the order of the rungs as the inversion and output of the watchdog signal must follow the edge detector rung. (The OK bit rung can come before or after the output rung, as long as it follows the edge detector.)


www.birket.com P.O. Box 610190, Ocoee, FL 34761-0190 fax (407) 654-2150