← All exercises

Incrementing Watchdog

medium

Raises an alarm when an incrementing heartbeat value stops changing for the configured timeout.

What it teaches

Monitor a heartbeat counter instead of a pulsing bit. Save the last value, reset the watchdog whenever a different value arrives, and alarm when the value stays unchanged for the timeout. Any change proves fresh data, so skipped counts and signed rollover remain valid.

Parameters

TagDirectionTypeDefaultDescription
In_HeartbeatCountInputDINT0Heartbeat value incremented by the monitored controller
Cfg_TimeoutInputDINT1000Maximum time without a new heartbeat value, in milliseconds
Sts_AlarmOutputBOOL01 when the heartbeat value has stopped changing

Required behavior