The panel's built-in communication-good toggle flips every five minutes, so an alarm built on it alone lands 1 to 6 minutes after a link loss. Add a PLC heartbeat counter that ticks every 2 seconds, show it on the panel, and watch a panel-written bit with a 6-second watchdog: the same failure lands in 4 to 6 seconds.
Keep the panel's built-in communication-good toggle as a slow indicator, and make the link check fast with a heartbeat counter in the PLC that the panel has to display. The toggle flips state every five minutes and its help file documents no way to shorten that, so an alarm watching it alone lands 1 to 6 minutes after the link dies. A counter that ticks every 2 seconds on the panel screen, watched by a 6-second PLC timer on a bit the panel writes back, lands the same fault in 4 to 6 seconds. This article sets both signals up, shows the sizing arithmetic, and ends with the cable-pull test that confirms detection and recovery.
What the five-minute toggle is good for
The help file for the communication-good toggle states the period: the variable flips every five minutes, and the same page documents no setting to change it. That makes it a dependable answer to one question: was the link carrying traffic recently? It is a poor answer to any question with a deadline.
The arithmetic shows why. A watchdog that resets on every flip and trips at a preset of 360 s (the 300 s period plus a 60 s margin, about 20%, to absorb scan and poll jitter) fires 360 s after the last flip. The last flip lands somewhere between 0 and 300 s before the cable comes off, so the alarm arrives between 360 − 300 = 60 s and 360 s after the break.
One check before you build on it: put the toggle in a watch table and timestamp two consecutive flips. Expect about five minutes between them. If it never flips with communications healthy, use the escalation in the first FAQ before changing anything on a running machine.
Skip these four quick fixes
- A shorter preset on the toggle alone. With the timer resetting on every flip, any preset under 300 s trips inside the normal gap between flips, and any preset over 300 s is reset by the next flip before it can trip. No preset on the toggle alone detects anything.
- Watching an ordinary process value. A temperature or level that legitimately holds steady for an hour cannot announce a dead link.
- A PLC heartbeat with no reader. The counter increments with the panel unplugged, which is exactly what makes it a good clock and, with nothing consuming it, no test at all.
- Trusting a static number on the screen. A frozen count reads like a live one until operators are taught to watch it step.
A timeout alarm that comes and goes while the rest of the screen keeps updating is a different fault with different causes; why an HMI shows an intermittent PLC communication timeout walks that one.
What you need
- A PLC with one free on-delay timer and one free integer register for the heartbeat count
- Access to the panel project in its programming software, plus the manual pages for the communication-good variable and numeric display objects
- A numeric display object on the main operator screen
- A watch table or online mode for commissioning
- A stopwatch and a planned window for the cable-pull test
Add the fast heartbeat counter in the PLC
- Pick the tick period. 2 s is a sound default: slow enough to ride out normal poll jitter on a single register, fast enough that detection stays in seconds. If reads on that register already run slow, fix that first; fix Modbus TCP data slow to update on an HMI panel is the article for it.
- Write a self-incrementing counter. Use an integer register that adds 1 every 2 s, driven by a self-resetting timer in the PLC, and let it wrap at a value the display handles cleanly, for example 9999.
- Run it blind. The counter must increment with the panel cable unplugged. Confirm that in the watch table before anything else; that independence is what turns it into a clock the panel has to keep up with.
Use a counter, and not a flipping bit: a bit that misses two updates lands back on its original value and looks healthy, while a counter jumps by the number of missed ticks, so skipped updates stay visible.
Show the counter on the panel
- Map the register to a numeric display object on the main operator screen, with the same PLC driver and address format as the process tags. The number then travels the same read path as everything else on the screen, so a stalled number means the read path has stalled.
- Download the project and watch. The displayed value should step once every 2 s. Mapping a live PLC counter to a numeric display works the same way as the run-hours counter in show motor run hours on an HMI from a PLC counter.
- Pull the comm cable at the panel in your planned window and record what the panel does: an error banner, a frozen number, or both. That recorded behavior is what operators are taught to read as a dead link.
- Restore the cable and confirm the count resumes, jumping forward by the ticks it missed.
Watch the panel from the PLC side
- Give the panel a way to write. Look in the programming software for a scheduled or event-driven write that sends a value to the PLC on a timer; the manual names the feature where it exists. Point it at a spare PLC bit and set the period to 2 s.
- Map the built-in toggle as the slow input. The help file names the toggle variable and shows how to map it to a PLC address; confirm there which side writes it. A toggle the PLC writes and the panel displays exercises the PLC-to-panel direction; only a signal the panel writes shows the panel is alive.
- Watch each signal with a self-resetting timer. Some controller and panel pairs also include a built-in life bit, a bit the CPU maintains while the panel polls it; if the controller manual documents one, watch it with the same logic and skip the mapped toggle. The logic itself, with illustrative names and the standard IEC 61131-3 TON timer:
(* Illustrative names; TON is the standard IEC 61131-3 on-delay timer.
HMI_Toggle stands for the watched signal: the fast panel-written bit
or the mapped communication-good toggle. Set T_wd to match:
T#6s fast, T#360s slow. *)
T_wd : TIME := T#6s; (* watchdog preset *)
Prev : BOOL := FALSE; (* previous state of the watched signal *)
Changed : BOOL; (* TRUE for one scan on any change *)
Wd : TON; (* watchdog timer *)
HMI_Lost: BOOL; (* link-loss alarm bit *)
Changed := HMI_Toggle <> Prev;
Prev := HMI_Toggle;
Wd(IN := NOT Changed, PT := T_wd);
HMI_Lost := Wd.Q;
- Set the presets. Fast path: 6 s, which is 3 × the 2 s tick, so two missed writes ride through and the third trips the alarm. Slow path: 360 s, the 300 s period plus the 60 s margin, so normal gaps never trip it. Both presets sit above their periods; a preset equal to its period trips on one late update.
- Check it. Pull the cable and confirm HMI_Lost sets within the preset. Restore the cable and confirm it clears on the next update; on the slow path that can take up to five minutes, and any machine logic on HMI_Lost has to tolerate that clearing delay.
Worked example: sizing a packaging-line link alarm
Scenario: one operator panel on a packaging line over Modbus TCP. The line supervisor wants a dead link known inside one minute.
Toggle alone: period 300 s, preset 360 s. The alarm fires 360 s after the last flip, which is 60 s to 360 s after the cable comes off. Worst case 6 minutes: the requirement fails.
Fast heartbeat: HB_Count ticks at 2 s on the panel screen and the panel writes a toggle bit at the same 2 s. Preset 3 × 2 s = 6 s. The alarm fires 6 s after the last write, which is 6 − 2 = 4 s to 6 s after the break. Worst case 6 seconds, a tenth of the one-minute budget. The operator symptom is instant either way: a number that has stopped stepping.
What each signal detects
| Signal | Detects | Alarm after | Role |
|---|---|---|---|
| Built-in communication-good toggle | the link carried traffic recently | 60 to 360 s after the break (preset 360 s) | slow PLC watchdog |
| Heartbeat count on the panel screen | the panel still reads the PLC | 4 to 6 s after the break | operator-visible freeze |
| Fast bit the panel writes | the panel still writes to the PLC | the preset, 6 s in the example | fast PLC watchdog |
| Built-in life bit, where the controller manual documents one | the CPU still sees the panel polling | the period the manual states | replaces the mapped toggle |
Decide what the alarm does
Temporary restore: run the on-screen counter with an alarm on HMI_Lost. Production continues and the loss stays visible. Permanent fix: decide in the PLC what HMI_Lost does, alarm only, hold the machine state, or a controlled stop, and write the decision into the project documentation. A panel used only for reference reading needs the alarm only; specify a read-only process display for a plant covers that case.
A stop that protects people is a safety function: it belongs in safety-rated devices and safety logic, and this watchdog is a diagnostics signal.
If the alarm text also has to be readable away from the panel, a separate shop-floor notice display can carry it. IMD Signage builds panel-mount displays for that job; they play images and video from microSD or USB, or your own Android app, and the watchdog logic stays in the PLC either way. Browse the shop-floor screens section for the range.
Recommendation
Recommendation: put the 2-second heartbeat counter on the panel screen and the 6-second watchdog on the panel-written bit in every project where an unnoticed link loss would cost time; map the built-in five-minute toggle to the PLC at a 360-second preset as the slow watchdog, and let the toggle carry the load alone only for a display-only panel where a late alarm is acceptable.
Confirm it end to end
- Watch table: HB_Count increments every 2 s with the panel cable unplugged.
- Panel connected: the on-screen count steps at the same rate.
- Toggle: timestamp two flips and confirm about five minutes between them.
- Pull the cable in the planned window. Time each indicator to its alarm and write the numbers into the project file.
- Restore the cable. Time each indicator to clear; expect the slow path to take up to five minutes.
- Power-cycle the panel with the PLC in run. HMI_Lost sets during the boot and clears at the panel's first write; if that transient must not reach machine logic, mask the alarm for a startup window.
- Log the tested tick and preset values with the project so the next engineer inherits them.
Questions
The communication-good toggle never flips even though the screens update. What now?
Confirm it first: put the variable in a watch table and timestamp two consecutive changes over ten minutes or so. If the on-screen values update but the toggle holds still, stop editing project settings on a running machine. Contact the panel vendor's technical support with the panel model, the programming software version, and the PLC driver the project uses, and keep the fast heartbeat running as the live link check while you wait.
Can I test the watchdog without pulling the communications cable on a running line?
Yes. Bench-test the panel and PLC pair first, or wait for a planned stop. In a copy of the panel project, disable the scheduled write and the screen mapping of the heartbeat register, download to the panel only while the line is down, and watch HMI_Lost: it should set at the preset and clear on the next real update. Never simulate a link loss by editing the live project while the machine is running.
Is a 1-second heartbeat tick better than 2 seconds?
Only if the panel's poll interval for that one register stays well under 1 second, and few do. The arithmetic still holds: a 1-second tick with a 3-second preset detects a loss in 2 to 3 seconds. But once the poll interval approaches the tick period, missed polls look like a dead link and the alarm trips on healthy traffic. Two seconds with a 6-second preset survives real scan loads.
Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.