Explainer
Why a Modbus TCP bit over Wi-Fi is not a PLC safety interlock
Short answer
A reject bit that toggles between two PLCs over Wi-Fi Modbus TCP proves the network path, not a dependable stop. Treat it as a non-safety permissive, add a toggling heartbeat with a comms-loss timeout sized from the measured poll interval, alarm and stop on timeout, and put any true safety function on wired, safety-rated equipment.

On this page
That reject bit toggling between the two PLCs over plant Wi-Fi proves one thing: at that moment, a Modbus TCP round trip worked. It does not prove the conveyor will stop dependably, and it can never carry a safety function. The decision: treat the bit as an ordinary, non-safety permissive; have the sending PLC toggle a heartbeat bit and size the receiving PLC's comms-loss timeout from the measured poll interval and delivery delay (1 s under the worked example's numbers); alarm and stop the line in a controlled way on timeout; and keep every function whose failure could expose a person on wired, safety-rated hardware. IEC 61508 draws the line between those two cases, and ordinary Modbus TCP messaging sits on the wrong side of it.
What the toggling bit actually proves #
Seeing the bit change in both projects confirms three things at the instant you watched: the two controllers reach each other, the read resolves the coil you intended, and both PLCs are in Run. It proves nothing about the next second. Wi-Fi retransmits frames, stations roam between access points, and an access point can reboot mid-shift, so delivery time swings from milliseconds to seconds with no worst case you can state.
Modbus TCP adds no supervision of its own at the application layer. If the link dies, the receiving PLC keeps the last value it read, and a bit frozen at no-reject from a crashed sender is indistinguishable from a healthy permissive. That frozen value is the failure mode that turns a convenient trick into a line that keeps running with its permissive dead.
What IEC 61508 requires that this link cannot deliver #
IEC 61508 is the basic standard for functional safety of electrical, electronic and programmable electronic systems. It requires a safety function — sensing, logic, actuation and the communication between them — to be engineered and validated against a quantified tolerance of dangerous failures, and it defines how a bus used inside a safety function is tested and certified for that role.
That is why certified safety protocols exist as a layer on top of ordinary Ethernet: message counters both ends cross-check, timestamps and acknowledgments that catch lost, delayed, duplicated or stale messages, exchanged between devices certified to the standard. Plain Modbus TCP carries none of those services — no application-layer counter, no safety timestamp — and no certification scheme qualifies it as a safety transport. Certified wireless safety systems are their own architecture, built on a certified safety protocol; ordinary PLC messaging over plant Wi-Fi is not that, and a stop function built on it has no claim to meet the standard, no matter how often the demo works.
Where the Wi-Fi bit is allowed to act #
One question decides it: what happens if the reject signal is late or never arrives? If the honest answer is a jam, scrap, or a cart that should have been kicked, and loss of communication ending in a controlled stop is acceptable, the link can carry the permissive as an ordinary control signal. If the answer includes a person — the reject gate also keeping hands out of a nip point, or the stop doubling as an emergency stop — the function belongs in the wired, safety-rated chain: its own sensing, a safety relay or safety controller, and direct drop-out to the contactors. That is the same judgment as blocking a line with a wired run permissive instead of trusting a network bit with it.
One safety rule bounds all of this: the Wi-Fi link, with or without a heartbeat, never acts as an emergency stop and never stands alone between a person and moving machinery.
Build the non-safety permissive #
Read, do not write. The conveyor CLICK reads a block from the vision CLICK, and neither controller is written into remotely. A remote write changes bits inside the other project with no visible owner, and the next person to troubleshoot the conveyor finds logic moving with nothing in the conveyor program to explain it — the same trap as what happens when two SCADA servers write to one PLC over Modbus TCP. With a read, the conveyor program owns every decision and one direction of traffic carries the truth.
Map a block rather than a lone bit. For example, reserve C100 through C120 on the vision CLICK: first bit is the heartbeat, second is the reject permissive, the rest stay spare with documented meanings — the block read costs the same as a single-bit read and leaves room to grow. Before trusting the mapping, open the CLICK's Modbus addressing documentation: it maps each memory range, including the C control bits, to specific Modbus addresses, and both projects must resolve the same address or the read silently targets the wrong bit.
Pace the read with a self-repeating timer in the conveyor CLICK and measure that pace, because the timeout hangs off it; scan time, instruction timing and link response all set it, as covered in what decides Modbus TCP polling speed to a CLICK PLC. The receive instruction also flags an error when no reply arrives within its response-timeout setting — wire that flag into the same alarm logic as the heartbeat, because either one means the permissive is not fresh.
Size the comms-loss timeout from measured numbers #
The sender toggles the heartbeat bit on a fixed period, so a state change is due at least once per period. The receiver stores the last observed state and resets a timer on every change; on timeout it sets the comms-loss alarm, drops the permissive and stops the conveyor in a controlled way. Recovery never restarts the line by itself: fresh data re-arms the logic and a person issues the intended reset.
Size the timeout as the toggle change interval plus the poll interval plus the worst delivery delay plus a margin. Worked example, with illustrative numbers from a bench test:
- Toggle period 250 ms, so a change is due every 500 ms.
- The block read runs every 100 ms.
- Worst delivery delay measured across the WLAN: 200 ms (one retransmission at the access point).
- Margin: one more retransmission window.
Timeout = 500 ms + 100 ms + 200 ms + 200 ms = 1000 ms, so the timer gets 1 s. Check both directions. Healthy worst case: the longest gap between observed changes is 500 ms + 200 ms = 700 ms, so 1 s leaves a 300 ms margin and will not nuisance-trip. Failed sender: loss is declared within 1 s of the last observed change, and since that change can itself arrive 200 ms late, the stop command is out within about 1.2 s. If 1.2 s is too slow for the process, shorten the toggle period and the whole sum shrinks with it — the arithmetic sets the number, not a rule of thumb.
Prove it before you trust it #
Test the failure, not just the success. With the line under control and nobody inside the hazard zone:
- Change a test bit on the vision side and watch the raw received value land on the mapped destination in the conveyor CLICK, then watch the conveyor logic respond.
- Start the heartbeat and confirm the receiver sees repeated changes, not only the first transition.
- Break the link in a controlled way — switch off the radio on the non-safety network or pull the patch cord where nothing else depends on it — and confirm the timer sets the alarm, drops the permissive and stops the conveyor.
- Restore the link and confirm the line stays stopped until fresh data arrives and the intended reset is issued.
- Tell the crew as well: a link-loss alarm at the operator station, built the way a SCADA PLC communication alarm for link loss is created, shows people what happened — but the stop decision itself lives in the conveyor PLC, because the SCADA path can be down at exactly the wrong moment.
The decision for each case #
A missed or late reject can expose a person: the interlock is wired and safety-rated — its own sensing, a safety relay or safety controller, direct drop-out to the contactors, validated as a complete function. The Wi-Fi bit may raise a warning at most. Decision: the interlock never runs on this link.
A missed reject means scrap or a jam, and loss of communication may end in a controlled stop: run it as a non-safety permissive — one read of a mapped block with the heartbeat in its first bit, a timeout sized by the sum above from the measured poll interval and delay, an alarm and a controlled stop on timeout, an explicit reset before restart, and the address map and timeout basis written into the project records. Decision: acceptable with that monitoring in place.
The line should ride through Wi-Fi dropouts without stopping: reject it. A permissive that survives lost communication is a stop function in disguise, and the standard has already ruled this link out of that role. If the motion behind the permissive cannot tolerate a stop on comms loss, that motion does not belong behind this link. Decision: rework the architecture, not the timeout.
Questions asked
Does a heartbeat make the Wi-Fi Modbus link safety-rated?
No. A heartbeat is an application-level freshness check for ordinary logic; it detects a stale link, nothing more. IEC 61508 requires the entire safety function, including its communication, to be engineered and validated to a quantified failure measure, and certified safety protocols add cross-checks such as message counters and acknowledgments that plain Modbus TCP does not carry. Use the heartbeat for availability, and keep the safety function in the wired, safety-rated chain.
How do I size the timeout before any measurements exist?
Set the timer to the worst healthy gap between observed changes plus a retransmission margin, the same sum the worked example uses, and start generous until you have measured. Run the toggle and the block read, record the real worst-case delivery delay, tighten the sum, and prove the final number with one deliberate link break that shows the alarm, the controlled stop and no nuisance trips. An untested timeout is a guess.
Why read the reject bit instead of writing it into the conveyor PLC?
A read keeps the truth in one direction: the conveyor program owns every decision, and the next troubleshooter finds one owner per bit. A remote write changes bits inside the other project with no visible origin in that project, and two writers to the same bit can fight. The write pattern does fit one layout — a main PLC pushing values out to several simple remotes, where the writer is obvious.
Do both PLCs need to watch a heartbeat?
Yes when both sides act on the exchange. Give each PLC one read of a block that contains the partner's heartbeat, and let each run its own timer, alarm and stop on its own timeout. Monitoring one direction leaves the sender blind: if the receiver dies, the sender keeps toggling into a dead link and believes its permissive is being served.


