Skip to content
Hakan KaracaENGINEERING JOURNAL
Automation EngineeringEki 8, 20263 min read

PLC Watchdogs and Communication Health: Detection Is Not Recovery

PLC, SCADA ve veri toplama sistemlerinde watchdog/heartbeat tasarımını anlatan saha odaklı rehber.

A watchdog can reveal that expected progress has stopped, but it must be designed around a clear failure model.

The term watchdog is used for several related mechanisms: a controller’s task watchdog, a device watchdog, a heartbeat between two systems, or a supervisory check that a value is changing. These are not interchangeable. A task watchdog may detect execution overruns inside a controller; a communication heartbeat may detect that a peer is no longer responding; and a process-value plausibility check may detect that a sensor is frozen even though the network remains healthy.

Choose the signal that answers the right question

A static Boolean that remains TRUE proves very little about communication health. A counter or toggling heartbeat provides evidence of recent progress, but only if the receiver checks the expected timing and the producer updates it independently of the faulty path being monitored. If the heartbeat logic is in the same blocked task as the process logic, a failure can leave a deceptively fresh or stale state depending on where the update occurs.

Define timeout behaviour explicitly

Select a timeout from the expected update interval, communication jitter and acceptable detection delay. A timeout that is too short creates nuisance alarms; one that is too long delays fault recognition. The decision must be tied to the consequence of missing an update, not simply to a convenient round number.

Specify the state machine: Healthy → Suspect → Faulted → Recovering → Healthy, or another clearly defined set of states. Decide whether the alarm latches, how reset is authorised, whether recovery requires multiple good samples, and which downstream values are marked invalid during the fault.

Example of a counter-based heartbeat

A producer increments a monotonically increasing counter at a known interval. The receiver records the last observed counter and time. If the value changes within the permitted window, communication progress is observed. If it remains unchanged beyond the timeout, the receiver raises a communication-health fault. A rollover in a fixed-width counter must be handled deliberately, and the receiver should not confuse a restart with normal progress without additional context.

Test beyond the happy path

  • Disconnect the network cable or disable the route.
  • Stop the producer task while leaving the network up.
  • Restart either endpoint and observe counter reset behaviour.
  • Introduce delayed and duplicate messages where the transport permits it.
  • Restore communication and confirm the alarm clears only according to the documented rule.
  • Verify that dependent data are flagged stale rather than silently treated as current.

A watchdog is not automatically a safety function

Do not credit a general heartbeat with a safety integrity capability it was not designed, implemented and assessed to provide. Safety-related fault detection requires the applicable architecture, components, diagnostics, failure analysis and verification. The correct response to a lost heartbeat also depends on the machine risk assessment: stop, hold, degrade gracefully or require an operator decision.

A healthy indicator should mean something precise. “The counter changed recently” is measurable; “everything is fine” is not an engineering specification.