SoC
  • Home
  • Arm
  • Arm Cortex M0/M0+
  • Arm Cortex M4
  • Arm Cortex M3
  • Contact
Reading: What is watchdog in PLC?
SUBSCRIBE
SoCSoC
Font ResizerAa
  • Home
  • Arm
  • Arm Cortex M0/M0+
  • Arm Cortex M4
Search
  • Home
  • Arm
  • Arm Cortex M0/M0+
  • Arm Cortex M4
Have an existing account? Sign In
Follow US
  • Looking for Something?
  • Privacy Policy
  • About Us
  • Sitemap
  • Contact Us
© S-O-C.ORG, All Rights Reserved.
Arm

What is watchdog in PLC?

Graham Kruk
Last updated: September 14, 2023 4:00 am
Graham Kruk 9 Min Read
Share
SHARE

A watchdog timer (sometimes called a watchdog or just watchdog) is an electronic timer that is used to detect and recover from computer malfunctions in programmable logic controllers (PLCs). The watchdog timer resets itself periodically and triggers a system reset if it is not reset before the time interval lapses. This helps improve the reliability and stability of the PLC system.

Contents
How watchdog timer works in PLCWhy watchdog timers are needed in PLCsHow to implement watchdog timersHardware watchdogSoftware watchdogTypical watchdog implementation in a PLCExamples of watchdog timers in commercial PLCsAllen-BradleySiemensOmronMitsubishiTips for using PLC watchdog timersSummary

PLCs are special computers used in industrial control systems to automate processes and machinery. They are designed to be extremely reliable and fault-tolerant. However, they can still experience malfunctions like any computer – for example due to electronic noise, power glitches, software bugs, etc. The watchdog timer acts as an automatic safeguard to detect such faults and reset the system before they lead to larger failures.

How watchdog timer works in PLC

The basic working principle of a watchdog timer in a PLC is as follows:

  • The watchdog timer circuit is built into the PLC hardware or software. It consists of a counter that regularly counts down to zero from a preset value.
  • The PLC program must periodically restart or ‘kick’ the watchdog timer to prevent it from reaching zero. This is done by writing to a specific watchdog register that resets the timer counter.
  • As long as the PLC program operates normally, it will keep kicking the watchdog at regular intervals before timeout.
  • If the PLC program crashes or malfunctions, it will fail to restart the watchdog timer.
  • When the timer expires and counts down to zero, it will trigger a reset signal to restart the PLC and recover normal operation.

The time period for the watchdog timer is set carefully depending on the PLC application. Typical timeout periods range from tens of milliseconds to a few seconds. The PLC program needs to reset the timer before this timeout, otherwise the watchdog will reset the system.

Why watchdog timers are needed in PLCs

Watchdog timers provide an easy and effective way to automatically detect faults and reset malfunctioning PLC systems. Some key reasons why watchdogs are important in PLCs:

  • Detect stuck programs – Watchdog can identify program crashes, infinite loops, deadlock conditions that ‘hang’ the PLC.
  • Recover from faults – Timely resets can restore normal operation instead of waiting for manual intervention.
  • Improve reliability – Periodic resets refresh entire PLC system and clear any latent issues.
  • Identify specific failures – If watchdog keeps firing, it indicates a specific program or hardware problem.
  • Low cost and simple – Watchdog hardware is inexpensive and easy to integrate.

Without a watchdog, minor faults can accumulate over time and lead to bigger failures that can be dangerous and expensive in industrial systems. The use of watchdog timers drastically improves the availability and safety of PLC controlled processes.

How to implement watchdog timers

Watchdog timers can be implemented in PLC systems in two main ways:

Hardware watchdog

A standalone hardware watchdog timer module is integrated into the PLC system. This watchdog timer circuit resets the PLC CPU directly if triggered. Some ways hardware watchdogs are implemented:

  • Separate IC on PLC board – For example, computer chip LM61810-ISP
  • Built-in CPU feature – Some PLC CPUs have inbuilt watchdog logic
  • Addon watchdog cards – External cards can be purchased to add watchdog reset function

The main advantage of a hardware watchdog is that it functions independently and resets the PLC even if the PLC program or OS crashes completely.

Software watchdog

A software watchdog timer module is built right into the PLC firmware or programming environment. The PLC ladder logic has to include a watchdog timer instruction that needs to be periodically triggered. If the instruction is not executed within the timeout, the system is reset. Some ways software watchdogs are added:

  • Firmware function blocks – Watchdog function blocks provided by PLC manufacturer
  • Custom ladder logic – Programmer can code watchdog timer logic in ladder diagrams
  • OS task monitor – Watchdog tasks built into PLC operating system

Software watchdogs have the advantage that they can be easily configured and modified without hardware changes. However, they rely on the program being in a functional state to operate.

Typical watchdog implementation in a PLC

A typical watchdog timer implementation in a PLC system would have the following key elements:

  • Watchdog Timer – This is the watchdog circuit that performs the actual timing and reset functionality.
  • Timer Value – Defines the preset countdown time, usually between 25 milliseconds to 5 seconds.
  • Reset Logic – PLC program code that periodically restarts the watchdog before timeout.
  • Reset Output – Signal from watchdog to reset the PLC CPU and peripherals.
  • Status Flags – Indicators that show if watchdog has timed out and reset the system.
  • Notification – Alert messages to notify operators of watchdog reset events.

The reset logic is usually implemented as a continuously executing portion of the ladder program. It resets the hardware or software watchdog timer register at regular intervals. If the rest of the program stalls or malfunctions, the timer expires and triggers reset signals to restart the PLC.

Examples of watchdog timers in commercial PLCs

Some examples of how major PLC manufacturers implement watchdog timers in their systems:

Allen-Bradley

  • Hardware watchdog – Built into ControlLogix, CompactLogix, GuardLogix CPUs
  • Software watchdog – RSLogix 5000 includes watchdog timer instructions

Siemens

  • Hardware watchdog – On-chip feature of S7-1200/1500 CPUs
  • Software watchdog – S7-300/400 has SW_WATCHDOG function blocks

Omron

  • Hardware watchdog – Included in Sysmac NJ/NX PLCs
  • Software watchdog – Uses WD_PNL instructions in ladder logic

Mitsubishi

  • Hardware watchdog – Built-in watchdog timers
  • Software watchdog – WDT and WDT_Start instructions

Most major PLCs provide both hardware and software watchdog timer options to improve reliability of the control system.

Tips for using PLC watchdog timers

Some design tips and best practices to follow when implementing watchdog timers in PLC systems:

  • Select suitable timeout duration – Too long can miss faults, too short can cause nuisance trips
  • Reset watchdog early and often – Reset at least 4x during timeout period
  • Handle watchdog events – Design program logic to handle resets gracefully
  • Retain variables – Use retain memory to preserve critical data across resets
  • Hardware preferred – Hardware watchdog works independently of program
  • Software watchdog as backup – Use as backup protection in case hardware watchdog fails
  • Test thoroughly – Validate watchdog operation during commissioning
  • Monitor flags – Check status flags to identify watchdog events

Properly configured watchdog timers will monitor the system continuously and provide a last line of defense against dangerous or costly PLC failures.

Summary

Watchdog timers are essential in PLC systems to achieve high reliability and uptime. They automatically detect program crashes and hardware faults, and reset the system before these issues can cascade into equipment damage or process disruptions. Both hardware and software watchdogs are used to maximize coverage. When implemented properly, the watchdog timer can identify problems early and restore normal operation quickly and safely.

Newsletter Form (#3)

More ARM insights right in your inbox

 


Share This Article
Facebook Twitter Email Copy Link Print
Previous Article What is watchdog in microcontroller?
Next Article What is an example of a watchdog timer?
Leave a comment Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

2k Followers Like
3k Followers Follow
10.1k Followers Pin
- Sponsored-
Ad image

You Might Also Like

Does Arduino use ARM architecture?

The short answer is no, Arduino does not use ARM…

6 Min Read

RTL simulation for designStart Cortex-M0, M3 and M4

RTL (Register Transfer Level) simulation allows designers to verify the…

7 Min Read

How Instructions are Fetched in Cortex M Processors?

Overview of Instruction Fetch in Cortex M The IFU fetches…

7 Min Read

How Many Interrupts Are Available in the ARM Cortex-M3/M4?

The number of available interrupts in ARM Cortex-M3 and Cortex-M4…

8 Min Read
SoCSoC
  • Looking for Something?
  • Privacy Policy
  • About Us
  • Sitemap
  • Contact Us
Welcome Back!

Sign in to your account