How-to
PLC-5 heartbeat without the PLC-5 sending messages
Short answer
Let the ControlLogix do all the sending: it either writes an incrementing heartbeat word to the PLC-5 over Ethernet MSG or pulses a spare output into a spare PLC-5 input, and the PLC-5 resets a watchdog timer only on a genuinely new value or pulse edge — never on message-complete status. Set the preset above two update periods plus measured transfer delay; in the worked example, 1500 ms detects a dead link within 1.5 s.
On this page
Yes — reverse the roles. The ControlLogix initiates every transfer, and the PLC-5 becomes a passive receiver whose only job is to time them: the ControlLogix either writes an incrementing heartbeat word into the PLC-5 data table over Ethernet MSG, or pulses a spare discrete output wired to a spare PLC-5 input. The PLC-5 resets a watchdog timer only when a genuinely new value or a fresh pulse edge arrives — never on message-complete status, which keeps reporting success even when the word it delivered has frozen. Derive the timer preset from your measured update period and transfer delay; the worked example below uses a 60 ms worst-case transfer delay and an update period P of 500 ms, and lands at a 1500 ms preset, so the PLC-5 declares the link lost within 1.5 s of the last good value.
Choose the channel: message word or discrete pulse #
Both channels keep every transmission on the ControlLogix side and put the watchdog where the consequence lands, inside the PLC-5.
| Channel | Who transmits | What the PLC-5 accepts as a reset | Choose it when |
|---|---|---|---|
| MSG write of a dedicated heartbeat word | The ControlLogix MSG instruction, configured as a write | The word differs from the last accepted value | The link already carries Ethernet messaging between the controllers and you want diagnostics travelling with the heartbeat |
| Discrete pulse, output to input | A ControlLogix output rung | The input shows a new off-to-on edge | You want plain timing with no message configuration, or the controllers sit on networks that do not route to each other |
A MSG read also works — the ControlLogix reads a word the PLC-5 program keeps changing — but the write is the cleaner build: the sender owns the value, and nothing in the PLC-5 has to produce changing data.
Whatever the channel, monitor a dedicated heartbeat word or pulse, never a process value. A batch setpoint can legitimately hold one number for an hour, and a watchdog fed by that value trips on perfectly healthy communication.
If the connection crosses a bridge rather than a direct Ethernet hop, plan and prove the route first, the same discipline as a CompactLogix MSG to SLC 5/04 through a DH+ gateway, because every extra hop adds delay your timeout has to absorb.
What the watchdog is allowed to reset on #
- Reset only on freshness: the received word differs from the last accepted value, or the input shows a new off-to-on edge.
- Never reset from message-completion status. A completed transfer proves the pipe, not the content — the same frozen word can be delivered perfectly for hours.
- Never reset from a level. A bit that is merely on survives a welded output, a cut wire read at the input, and a sender that has stalled; only a change or an edge proves something new crossed the link.
- Reset on every update, not every Nth update. The preset arithmetic below assumes each accepted update restarts the timer from zero.
These rules exist for one failure pattern: a sender that stops incrementing but keeps messaging. Enabled by the message-done bit, that heartbeat never trips. Enabled by change or edge detection, the same fault expires the timer within one preset, every time.
Set the timeout from your own numbers #
Compute the preset, do not copy it from another machine:
preset >= (missed updates tolerated + 1) × update period + measured worst-case transfer delay
Tolerate one missed update: a single lost or late message is normal on a shared plant network, and two in a row means the link is failing.
Worked example, with illustrative inputs — measure your own before you enter anything:
- Update period: P, as measured in the example above.
- Measured worst-case transfer delay: 60 ms, timed on the live link during the busiest production window.
- Tolerance: one missed update.
preset >= 2 × P + 60 ms = 1060 ms, so enter 1500 ms.
Check the result in both directions:
- False trip: one update is lost and the next arrives 1060 ms after the last reset. 1060 ms is under 1500 ms, so the timer never reaches preset.
- Real loss: two consecutive updates are lost. The next would arrive 1560 ms after the last reset (3 × P + 60 ms), but the timer reaches 1500 ms first — loss is declared at most 1500 ms after the last good value.
The pulse channel uses the same arithmetic: pulse 100 ms on and the remainder of P off, and apply the same preset. Keep the pulse wider than the input card's documented response times — 100 ms clears an ordinary discrete input with a wide margin, but confirm against your card's own sheet. Change the period or the measured delay and both checks must be redone; the numbers move, the method does not.
Build the message heartbeat #
- Reserve the data: one unused integer word in the PLC-5 data table and a sending tag in the ControlLogix. Illustrative names used below:
HB_Send(ControlLogix counter tag, initial value 0),HB_RcvandHB_Last(PLC-5 integer words, initial value 0). - In the ControlLogix, add a rung or periodic task that increments
HB_Sendby exactly 1 once per period, so every transfer carries a different word. - Configure the MSG as a write from
HB_Sendto the PLC-5 heartbeat word, triggered once per period. On the Logix side this is the same exercise as when you start and stop a PowerFlex 700 over EtherNet/IP from CompactLogix — target address, transfer size and pacing differ, the instruction and its status handling do not. - Prove the pipe before the watchdog: watch the PLC-5 word and confirm it steps by 1 twice per second.
- Enter the receiving logic in the PLC-5 — in ladder, an up-counting timer whose reset rung is the change test:
(* Illustrative logic; names are mine, not documented tag names *)
(* HB_Rcv : integer word, written by the ControlLogix MSG, increments each transfer *)
(* HB_Last : integer word, initial value 0, last accepted heartbeat *)
(* WD : up-counting timer, preset 1500 ms (15 at a 0.1 s time base) *)
IF HB_Rcv != HB_Last THEN
HB_Last := HB_Rcv; (* new value accepted *)
WD := 0; (* restart watchdog *)
ELSE
WD counts up; (* expires at preset after the last accepted value *)
END_IF;
HB_Lost := WD done; (* latched; operator acknowledge clears it *)
- Measure the worst-case transfer delay on the live link during your busiest window and confirm the preset still passes both checks from the timeout section.
- Route
HB_Lostinto the response you decided in advance: alarm, interlock, or both. - Run the lost-link and frozen-value tests in the commissioning list below before calling it done.
Or build the discrete pulse #
- Wire a spare ControlLogix output to a spare PLC-5 input through a relay contact whenever the two panels do not share a power supply, and match the PLC-5 input card's voltage class.
- Pulse the output 100 ms on and the remainder of P off, so the same preset applies.
- In the PLC-5, reset the same watchdog on the input's rising edge. On the edge, never on the level: a welded-on output and a cut wire both stop the edges and expire the timer, which is exactly the failure you want declared.
- Commission by watching the input status LED blink at 2 Hz, then confirm each blink restarts the timer and that holding the output on trips it within one preset.
The pulse channel proves transitions and nothing else — it carries no diagnostics. Run it alongside the message channel when you want status data as well; run it alone when simplicity and determinism matter most.
Test both failure modes #
Test with the machine in a safe state, and record the results in the project notes for the next engineer:
- Freshness at both ends: the sender steps twice per second and the accepted-value copy in the PLC-5 steps with it.
- Lost-link test: disable or unplug the path — the link itself or the message and pulse rungs. The watchdog expires at the preset,
HB_Lostlatches, and the interlock or alarm does what you designed. Log the actual detection time against the bound you computed. - Frozen-value test: leave the messaging running and stop only the incrementing — disable the increment rung or force the sender tag to hold. Completion status stays healthy while the watchdog still expires; this is the test a done-bit scheme cannot pass.
- Recovery: restore the path. The first fresh value resets the timer, and
HB_Lostclears only through the acknowledge path you built.
If an HMI or SCADA client watches the same link, give it the mirror-image discipline: it should show its timeout indication instead of freezing the last value, which is exactly the behavior covered in Why HMI values show question marks: PLC comms timeouts.
The decision, case by case #
- Same Ethernet between the controllers, diagnostics wanted: MSG write heartbeat, update period P, preset from the formula — 1500 ms under the example's inputs, recomputed with your measured delay.
- Different networks, or no message configuration wanted: discrete pulse, 100 ms on within period P through an isolated contact, same preset arithmetic.
- Path through a bridge or gateway: same build, add every hop's delay to the measured worst case before computing the preset.
- Loss must cause a safety stop: keep this heartbeat for process interlocks and alarms only. ISO 13849-1 requires the channel of a safety function — communication included — to meet the Performance Level assigned by the machine's risk assessment, and a plain MSG or a spare I/O pulse is not such a channel. Keep the safety stop on hardwired circuits, shaped to the stop category the machine's IEC 60204-1 requirements call for.
One sender, one receiver, reset on freshness only, preset derived from your own numbers — the PLC-5 never sends a message.
Questions asked
Does the timeout change if the heartbeat runs over a serial link instead of Ethernet?
The method does not care about the transport, because the PLC-5 only watches a data word or an input edge. Only the timeout moves. A serial or bridged path has a longer and more variable transfer delay than a direct Ethernet hop, so measure the worst case again on that link and re-run the same formula. Keep both checks from the worked example: a preset that passes them cannot false-trip on one late message and cannot miss a real loss, whatever the wire carries it over.
What happens if the sender and receiver word sizes differ?
Match the sizes before you commission. Transfer the heartbeat as an integer-sized write so the PLC-5 receives one clean word, and keep the sender counter within the range the receiver word can hold — or let it wrap on purpose, which is safe here because consecutive values always differ and the change test keeps firing. The scheme breaks when a transfer rewrites part of the word or pads it inconsistently, producing phantom differences. Step 4 catches it: the received word must step by exactly 1, twice per second.
Can the ControlLogix also detect the loss from its side?
Yes, without any PLC-5 transmission. The write itself reports faults, so give the ControlLogix its own watchdog fed by the message error status: a faulting transfer sets the sender-side loss bit within its own timeout. Understand what each side proves. The sender detects a failed transfer path; it cannot see a PLC-5 program that has stopped consuming the word. Only the receiver-side change test proves consumption, which is why the watchdog lives in the PLC-5 even though the PLC-5 never transmits.
How should the loss bit clear once the link recovers?
Through an operator acknowledge, not automatically. Latch the bit when the watchdog expires, let the machine response run its course, and clear it only when someone confirms recovery. That prevents a flapping link from cycling the interlock up and down on its own while the fault comes and goes. Pair the acknowledge with your normal restart procedure so nobody resets the heartbeat while the machine is still expected to stay down, and record the trip and clear times with the commissioning results.