If the panel-to-PLC link dies the moment the USB programming cable comes out, the cable was supplying the panel's ground reference. Land the HMI's ground wire on the same point as the PLC ground, then prove the fix by running the link with the cable unplugged.
When the panel-to-PLC link dies the moment the USB programming cable comes out, the cable was doing a job nobody assigned it: carrying the panel's ground reference. The panel's 0 V rail is floating. While the cable is in, the laptop bonds that rail to earth through the USB ground pin; pull the cable and the rail drifts, the serial receivers lose the rail they measure against, and the link stops. The repair is electrical and quick: land the HMI's ground wire on the same point as the PLC's ground, then run the link with the cable out. This page gives the symptoms, two meter checks that confirm a missing bond, the repair, and a worked 24 V DC example.
Why the link dies when the cable comes out
A serial link between an HMI panel and a PLC only runs when both ends sit on one 0 V reference. The receivers judge every signal against that rail. A panel whose reference floats has nothing to judge against, so the link stops even though both ends are powered and the cable between them is intact.
The USB programming cable has been supplying the missing reference. USB carries 5 V on its power pin, and the ground pin ties the panel to the laptop, the laptop to the building's earth, and from there to the panel's protective ground. At least one HMI maker documents the mechanism in its installation manual: plugging in a USB device connects the panel's 0 V to protective ground. That bond is why programming works and why the link holds while the cable is in. It also explains why ejecting the cable cleanly changes nothing: the path opens either way.
Without the cable, the two reference rails separate, the panel's rail drifts with its internal supplies and the loads around it, and the receivers read noise in place of data. Firmware, project file and PLC program are innocent here; nothing in any of them creates or repairs a ground bond.
Symptoms and what each points to
- The link runs with the cable in and dies seconds after it comes out. The panel is missing its ground bond. The two checks below confirm it with a meter.
- The failure is identical on every programming PC. The PCs share only the panel and its reference, so the condition lives in the installation, not in a PC setting.
- The link is dead with the cable in and out. A missing bond is not the only thing that stops a link. If the panel reports timeouts and the outputs hold their last state, work through fixing an HMI communication timeout when outputs hold state.
- The panel only stays healthy while the cable carries power. That is a feed problem, not a reference problem, and it calls for the HMI programming cable power pin check before anything else.
- An update error sits in the log beside the com failure. Park it. The bond comes first; the firmware question at the end of this page covers the rest.
Two checks that confirm the missing bond
Isolate and lock off the panel feed before you open the door and put hands on conductors, and never open a ground conductor to test it while the panel is energized.
- Continuity, power off. Meter from the HMI's ground terminal to the stud or bus point where the PLC's ground lands. A sound conductor reads close to 0 Ω. An open reading confirms the termination is missing or bad.
- Voltage, power on, cable out. Energize the panel, leave the USB cable unplugged, and meter DC between the HMI's 0 V terminal and the PLC's 0 V terminal. A bonded pair reads 0 V DC, steady. Any steady offset, or a reading that moves when a motor down the line starts, means the two rails are separate.
If both checks come back healthy, the bond is fine and the fault sits in the link itself; start with the link's settings and cable before touching the project.
The fix: one ground point for panel and PLC
The repair is a permanent wire. Land the HMI's ground wire on the same stud or ground-bus point the PLC's ground uses. A properly built control panel has a way to ground every metal part a person can touch, and the two grounds belong at one common point on it. Feed the panel as its installation manual shows; the same manual that documents the USB bond advises running the feed as two wire pairs, and your panel's manual prints the arrangement it wants.
Do not add a jumper to a laptop or leave a spare USB cable in as the bond; the reference you borrowed disappears with the PC it came from.
Energize the panel, reconnect the link, and test with the programming cable out of the panel entirely. Watch the link through a few machine starts, because ground offsets show themselves when large loads kick in. Before anyone puts the machine back in motion, run the installed link through test writes before motion.
Recommendation: Land the HMI's ground wire on the same stud or bus point as the PLC's ground, feed the panel as its installation manual shows, and accept the repair only after the link holds through machine starts and a full shift with the programming cable out of the panel.
Example: a 24 V panel with no ground wire at the HMI
Inputs. The HMI runs from the panel's 24 V DC control supply, the usual setup this fault turns up in. The PLC's reference lands on the panel's ground stud, as built. The HMI's ground terminal is open, because the wire was never landed; that is the fault. The USB programming cable carries 5 V on its power pin with the laptop's ground on the ground pin, the values the USB standard sets.
The rule. Both ends of the link bonded at one point puts no potential difference between their reference rails, and a serial link needs that sameness to run.
The arithmetic. PLC reference to stud: zero, because they are the same point. Stud to HMI reference: zero, once the ground wire lands. So HMI-to-PLC across the two rails: 0 V + 0 V = 0 V, which is what the meter should read. Before the repair, the only path between the rails ran through the laptop: HMI reference, USB ground pin, laptop, building earth, panel protective ground, stud, PLC reference. Pull the USB plug and that chain opens; the meter stops reading a steady zero, and the link stops with it.
The result and the decision. With the wire landed on the stud, the link runs with the cable out, and the meter reads a steady 0 V DC between the two terminals. The pass mark is that steady zero. Any offset above it, or a reading that drifts as loads start, means the bond is still open, and the next move is the termination, not the project file.
If the link still fails with the cable out
The missing bond was one fault in the installation, and others can sit behind it. Work the link itself, one change at a time: both ends' port settings, then connectors and cable, then the run length against the maximum serial cable distance by interface. Keep the meter between the two reference terminals as your progress marker; it should hold a steady zero no matter what else you change, and if it does while the link still misbehaves, the reference is no longer the problem. Write down each change and each meter reading, so the handover to the next shift carries facts instead of guesses.
Questions
Why does the link drop even while the USB cable is still plugged in?
That points at the borrowed reference path. A laptop running on battery floats its own ground, so the bond through the USB cable moves with the machine and the panel's reference rail drifts while the cable is still attached. Keep the laptop on mains power while you reproduce the fault, and treat the cable as a clue only.
Can the USB programming cable stay in as a permanent fix?
No. The reference it supplies is an unintended path through whatever PC happens to be attached, and it disappears the day that PC is reimaged, replaced or off site. The documented arrangement is a ground wire from the panel to the same point as the PLC ground; the cable only showed you the wire was missing.
Should I reflash the panel before checking the ground?
No. An update cannot repair an open ground termination, a damaged cable or a floating reference rail, and an interrupted update adds a new fault on top of the old one. Fix the bond first, prove the link with the cable out, and treat an update error in the log as a separate job using the panel maker's documented method.
Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.