The toggle works in simulation because nothing there writes the address back. On the PLC, any rung that writes that output replaces the panel's value within one scan, about 1 to 10 ms on a small controller. Point the switch at an internal control bit and let one rung own the physical output.
The toggle is doing its job. In the simulator, nothing else touches the address, so the bit latches and stays latched. On the PLC the picture changes: if the program uses that address as an output anywhere, the logic rewrites it on the next scan and the panel's command dies inside one scan. The write succeeds and the program erases it. The cure is not a setting on the switch object. Move the toggle to an internal control bit, add one rung that drives the physical output through its permissives, and leave the program as the only writer to that output. This page shows how to tell the cases apart, find every rung that writes the address, and rewire the command so the machine's logic stays in charge of the load.
Why the PLC wins every time
A small PLC runs a loop: read the inputs, solve the logic in order, write the output image to the terminals. Solving a few hundred rungs takes about 1 to 10 ms, the typical scan time for a controller of this class. A panel write arrives over the communications link between two solves and sets the output image to 1. The next solve reaches the rung that owns that output, writes its own result, and the end-of-scan refresh sends the program's value to the terminals. Your 1 survives one scan at most.
The simulator looked right because nothing stands behind it: no program, no writes, no interlock that can refuse a command. The panel side of the link worked the whole time. The same ownership rule appears in the mirror case, why an HMI toggle cannot force a PLC physical input, where the screen writes a point the field wiring owns. For the timing of panel writes against the scan in detail, how many PLC scans an HMI momentary button bit stays on works it through.
What each symptom points to
Press the switch a few times with the machine in a safe state and watch the address in the programming software's online monitor. The pattern names the fault.
- The value never moves. The write path is the problem: the object's address is wrong, a different project runs on the panel, or the controller refuses writes. Work through how to prove why an HMI reads the PLC but cannot write.
- The value jumps on for an instant and drops again. A rung writes that address, and the next scan erased your command. That is the override this page fixes.
- The value latches on but the load stays off. The address is an internal bit with no rung wired to an output, or a permissive holds the output coil off. Trace from the bit to the output rung.
- The value toggles correctly and then changes again without a press. A second writer exists: another object on another screen, a second panel, or first-scan initialization logic. Two HMIs writing to one PLC: who wins the write sorts out the contenders.
The monitor samples the controller slower than the logic runs, so a one-scan erase can slip between two samples. Judge the pattern across several presses.
Find every rung that writes the output
Open the cross-reference for the exact address in the PLC project. List every instruction that can write it: output coils, set and reset coils, move instructions, and any initialization or fault routine that touches it. Watch the unconditional ones hardest: a coil with no contacts ahead of it writes its result into the address on every scan, on or off.
Then watch the address live while you press the switch and note three things: whether the value changes, how long it stays changed, and whether the physical output follows. Read the address type from the controller's address map too. On the controller family in the example below, physical outputs sit at Y addresses and internal control relays at C addresses. Other families use other letters, so take the type from the address map or the tag list.
Move the toggle to an internal control bit
The permanent fix gives the program one owner per output and gives the panel a command bit the logic listens to.
- Pick an unused internal bit, a C-type control relay in the example family. Search the program and every screen for writes to it first. A bit something else writes puts the same conflict straight back.
- Re-address the toggle switch object to that bit. Leave the object's type set to Toggle: one press commands on, the next press commands off.
- Add a rung that drives the output from the command bit in series with its permissives: command bit AND guard door closed AND no fault, coil out to the physical output.
- Rewrite or delete any rung that still writes the output from the panel's old address, so the program stays the single owner.
- Transfer the changed program with the machine in a safe state, through your site's approved download procedure, and confirm the panel is running the project you changed.
Never close the gap by forcing the output or lifting a permissive rung. The program must stay the only logic that can energize a machine output.
Recommendation: Address every toggle and set-bit object on the panel at an internal control bit, and let one PLC rung own each physical output through its permissives. Keep a toggle on a physical output only when the cross-reference shows nothing in the program writes it and the machine's operating procedure allows the panel to run the load directly.
Example: a 5 ms scan erases the write
Scenario: a pump output, Y0, on a controller with a 5 ms scan. Rung 12 drives Y0 from X2, the guard door switch. The panel's toggle addresses Y0 directly.
- The operator presses the toggle. The panel writes Y0 = 1 over the link, and the value lands between two solves.
- The next solve reaches rung 12. The door is open, so X2 is off and rung 12 writes Y0 = 0.
- The end-of-scan refresh puts Y0 = 0 on the terminals. The command survived one scan: 5 ms, which is 0.005 s.
- At 5 ms a scan, the program rewrites Y0 1000 / 5 = 200 times every second. No press can outlast that.
- Result: the pump never starts, and the panel's readback shows the address off again at its next poll.
After the fix, the toggle addresses C0, an internal relay nothing in the program writes, and a new rung reads X2 AND C0 into Y0. A press sets C0 to 1 and it stays 1. Door closed, Y0 runs the pump. Door open, Y0 drops out while C0 holds at 1, which is the interlock doing its job.
Test it before the machine goes back to work
Watch the command bit and the output as two separate lines in the monitor.
- Toggle on: the bit holds at 1 and the output follows it through the permissives. Toggle off: both drop.
- Command on, then open the guard door: the output must drop out while the bit stays at 1. That is the interlock working.
- Start up with the permissive absent: the output stays off until the permissive returns.
- If the command bit falls back without a press, a writer survives somewhere. Search the screens and the program again before the machine runs.
The same screen rules apply to any panel you put on the floor. If you also want a wall notice board or an andon-style status screen beside the machine, our shop-floor displays play your own shows offline from a memory card.
Questions
How do I prove the panel's write arrived at all?
Set the object to write a spare internal bit instead of the output and press it: if the bit changes in the monitor, the link, address format and project are all good, and the fault is ownership of the output. That one test separates a write-path fault from an override in under a minute.
Will the command bit keep its state through a power cut?
A plain internal bit returns to its programmed state at power-up, so a latch held only by the panel disappears with the power. If the command has to survive a power cut, the program has to keep it: some controllers offer retentive ranges for internal bits, others need first-scan logic that restores the state. Either way the PLC holds the bit and the toggle only changes it.
Can the toggle stay on the physical output if nothing in the program writes it?
It holds, but treat that as a stopgap. With no rung writing the output, the panel's value stands until a power-up or another write changes it, and the program has no say in when the load runs. One unconditional or initialization rung missed in the cross-reference puts the override straight back. The command-bit arrangement keeps the machine's logic in charge under every condition.
Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.