What is the function of a Watch Dog in PLC systems?

A

Thread Starter

Ahmad Samak

PLCs as well as Microcontrollers usually use what is called Watch Dog, may you help explaining why is this Watch Dog for in PLC systems?
 
T

Trevor Ousey \(lists\)

Watchdogs are basically timers used to keep check that the code does not get into a 'bogged down' state. Generally when the watchdog fault occurs the processor is faulted.
 
M

Michael Griffin

A watch dog is a timer which must be reset regularly before it times out, or it will cause the PLC or microcontroller to fault or reset. In a microcontroller your program would explicitely reset the watch dog. In a PLC, the watch dog is automatically reset during the I/O update (between program scans).

The watch dog timer is intended to prevent software bugs from causing the microcontroller or PLC program from hanging up. If you PLC supports loops or jumps you can test this by programming an infinite loop. The PLC should fault and either go into stop mode or perform whatever other fault action.
 
C

chris.priestley

The watchdog is there to inform you if the scan time of the PLC goes over specified limits, i.e. if the watchdog is set at 250ms and it takes the plc longer than that to scan through the program then the plc usually switches to fault mode and stops the program.
 
D

Daniel Chartier

Hello;

In a PLC your program is scanned cyclically and continuously, along with all the internal housekeeping jobs: reading inputs/writing outputs, managing communications and memory allocation. To ensure that you are correctly controlling your process you need to start the new scan within a maximum allowed time slot. The watchdog timer verifies that the present scan does not overrun that limit, which would mean you are either in an endless loop or you are not dealing with you prograsm adequately.

Hope this helps,
Daniel Chartier
 
Well, PLCs are applied in installations where availabilty and cycle times are important. The Watch dog simply monitors the execution time of a certain task and when it exceeds the permitted time it gives a signal.
 
T

Theo Baarslag

A PLC relies on one central processor to execute the users' program, but also to do the housekeeping (updating the time registers, the I/O image, network ports, etc.). To make sure that it does not take too long between housekeeping scans, it usually has a watchdog. The watchdog is a timer with a preset higher then the maximum scan time that is to be expected. If the watchdog timer times out, it is usually better to halt the execution and make sure that the programmer resolves the situation, because it might result in unwanted behavior of the machine or production line, even in damage or danger to persons nearby. Because the watchdog is an external circuit, it will still respond even if the central processor is tied up in too long program scans.

In a practical situation:
If the watchdog is triggered, you should normally check your program for eternal loops, or a too high amount of triggered routines (they are usually not taken into account when calculating the watchdog preset).

KR,

Theo Baarslag
PLC-/CIMspecialist
IAMS Europe bv
 
M

Marcelo Nunes

The Watch Dog is a timer. It´s used for safety reason. After a scan cycle the watch dog must be reset. If not the Watch dog timer reachs the preset and shutdown the PLC. Bescause it means the PLC didn´t finish the scan cycle in a predefined period of time.

Best regards

Marcelo Nunes
 
Watchdog timers are used for a couple of reasons in a PLC:

a. If you want to have an upper bounds for your scan time to ensure you don't get stuck in iterative loops for instance.

b. From a Peer comms or SCADA point of view, a PLC may look like it is OK because the comms is executing fine, but if you look at a watchdog timer and this is not incrementing or changing then you can determine that the processor is in fact not executing or stuck in some state.
 
A watchdog timer monitors the function of the processor. If the timer rolls to zero it will stop the process. This could indicate a hardware or software problem. Typically, when things are functioning properly, at a predetermined interval the processor will reset the timer before it can roll over. The best thing to do is search the internet, there are some good descriptions out there.
 
F
When I write embedded software I often include a watchdog timer that will restart the execution of the program if the scan does not complete in a certain amount of time. It is assumed that if the scan does not complete in a reasonable amount of time the program must have hung up. I have little PLC experience but I would assume that it's included for the same reason.
 
M
A watch dog is a hardware timer that is "kicked" by the application running in the PLC/microprocessor each time it starts (cyclically).

If the timer expires, indicating the the PLC/mirop is "stuck" in its code, the Watchdog "bites" the PLC/microprocessor, which in turn resets and stops in a safe mode.

Meir
 
G

Gerald Beaudoin

If you think about what a watchdog does in real life... he alerts you to any discrepant event taking place. In the PLC and microporcessor world, its just about the same job.
The watchdog timer checks to make sure that the scan time of the PLC or processor does not exceed a predetermined time. If it does, a fault is declared and the program is generally halted as this is an indication that something has gone seriously wrong with the normal processing of
instructions. In some PLCs this time can be adjusted to whatever value you feel is appropriate. Obviously this value will always be greater than the normal scan time of the program. If you are "sending a man to the moon", you
want to know ASAP that things have gone wrong…..and that's what the watchdog is there for.

Gerald Beaudoin
 
G

Glen Gallagher

Watch Dog timers are frequently used between two devices that need to communicate with each other as part of a control scheme. Loss of the communications link between the two devices may mean that you would need to modify or suspend the control actions in one or both of the devices due to the loss of information exchange.

You can program a watch dog timer in each device, and it is the watch dog timer which will provide the "trigger" to tell you that the communications between the two devices has failed.

A simple way to set it up is to have a repeating timer in Device #1 set to time out after a properly selected interval - say five seconds for example. Then a timer in Device #2 can be set at a shorter interval and be programmed to reset the timer in Device #1 - through the communications link.

As long as the communications link is functioning, the timer in Device #1 should never time out. If however, the link fails, then that timer in Device #1 will reach its time out setting, and that logic action can be used to initiate the appropriate "loss of communication" actions in Device #1.
 
C

Curt Wuollet

He protects all the trade secrets in there.

Actually a watch dog is simply a timer that needs to be reset periodically by the software running on the processor. If the watch dog doesn't get reset, the software is not running properly and the watch dog routine will do something about it, like reboot. Made popular by Windows.

Regards

cww
 
Top