An HMI button moves a machine when its tag writes a command bit the ladder also uses. An indicator shows the truth when it reads a separate status bit the ladder sets from the machine's real state. Build the pair on a bench test, watch both bits online, and connect machine outputs only after the light follows the sealed-in status bit.
Wire the HMI button to its own momentary command bit, wire the indicator to a separate status bit that a seal-in rung in the ladder controls, and prove both online before any machine wire moves. On the bench below, a 1 s press against a 5 ms scan gives the rung 200 scans to catch the command, and a 250 ms poll cycle puts the lamp state on screen within about a quarter second. The same two-bit pattern carries to any panel and any small controller. The article builds that pair as a two-bit bench test with one indicator lamp and both bits watched online, so the tags check out before any machine wire moves.
Why the button and the light get separate bits
A button sends a command. A light reports a condition. Point the indicator at the button's own bit and it draws the operator's finger: lit after a permissive has already killed the command, or dark while a sealed output keeps running. The ladder is the referee. It takes the command, checks the permissives, seals the status bit, and the indicator reports that decision.
The working convention among controls engineers is momentary writes from the panel with all latching done in the PLC. A maintained button keeps a second copy of the machine state on the screen. When the ladder changes that bit behind the operator's back, the button's graphic follows the PLC state on the next read, and the screen flips while a finger is still on it. With a momentary write, one side owns the state: the rung.
A momentary write lasts only while the button is held. How many PLC scans an HMI momentary button bit stays on covers what the ladder sees during that window.
What you need
- The PLC project and its programming software, with online access to a watch window.
- The project editor for the HMI panel.
- Two spare bits in a data area the ladder already scans. Call them HMI_START for the command and LAMP1 for the status; these names are illustrative, so use the addresses your program prints.
- One spare output point, one 24 V DC indicator lamp, and wire and terminals for it. 24 V DC is the standard control-circuit voltage on machine I/O.
- A spare input for PERMIT, the permissive contact, driven by a key switch you can open and close by hand.
- The programming cables for both devices.
Example: a two-bit bench test at 24 V DC
The bench uses a small PLC whose ladder scans in about 5 ms; 1 to 10 ms per scan is the typical range for small controllers. The HMI button writes HMI_START. Its indicator reads LAMP1 on a 250 ms poll cycle. You press the button for a full 1 s.
The seal-in rung:
HMI_START PERMIT LAMP1
--------| |------+-------| |------------( )--------
LAMP1 |
--------| |------+
HMI_START and LAMP1 in parallel are the seal. PERMIT is the permissive, left closed for the bench test. The coil is the status bit, and the output point wired to the lamp follows LAMP1.
The arithmetic for the press: 1000 ms / 5 ms per scan = 200 scans. Even at a slow 10 ms scan, 1000 ms / 10 ms = 100 scans. The rung sees HMI_START true for at least 100 scans, so it cannot miss the press.
The result: on the press, HMI_START sets, the rung fires, LAMP1 seals in through its own contact, and the lamp lights. Release the button and HMI_START clears while LAMP1 holds. The screen indicator, reading LAMP1 every 250 ms, shows the lit state within about a quarter second of the coil, one poll cycle plus a scan. Open the PERMIT key switch and LAMP1 drops, the lamp goes dark, and the indicator follows, all while the on-screen button sits released and untouched. That last step is the proof that the light reports the ladder's decision, not the press.
Steps
- In the PLC project, pick the two spare bits and the spare output point. Note each address and data type exactly as the program prints it.
- Write the seal-in rung. Download it to the PLC with the lamp wired to the output point and the machine outputs still disconnected.
- In the HMI editor, create the pushbutton object, give it a command tag, and point the tag at the command bit's address with a bit data type. Set the button's press action to momentary, the option that writes while pressed and clears on release; your editor names it in that neighborhood.
- Create the indicator object with a status tag pointing at the status bit. Set the status tag's poll cycle to about 250 ms; driver cycles from 100 ms to 1 s are typical for status bits, and 250 ms keeps the lamp feeling immediate.
- Connect the panel to the PLC, then go online with the PLC software so the rung and a watch window on both bits are visible beside the screen.
- Press the button for the full 1 s from the example. Watch HMI_START set, LAMP1 seal, and the lamp light.
- Release. Confirm HMI_START clears and LAMP1 stays on.
- Open the PERMIT switch. Confirm LAMP1 drops, the lamp goes dark, and the screen indicator follows.
- Run the press, release, permissive-open cycle about 10 times before you trust the pair.
How to check it worked
- Command bit: sets while pressed, clears on release, in the watch window.
- Status bit: seals on the command, holds after release, drops when the permissive opens.
- Lamp: follows LAMP1 and lights within about one poll cycle.
- Indicator: goes dark when you clear LAMP1 from the PLC side while the screen button is untouched. If the screen light follows the button instead of LAMP1, its tag points at the command bit; move it to the status bit.
- Nothing changes at all: check the tag's address and data type against the program first, then the cable and driver. Operator panel PLC link setup: test writes before motion walks the link side of that test.
Before the machine gets connected
Add the real permissives to the rung before the panel goes on the machine: guard closed, drive enabled, home position, whatever the machine requires, each as a contact in series with the seal. You can also keep an operator from pressing at the wrong time by hiding the object until the PLC allows it; gate HMI button visibility on a PLC timer done bit shows one version of that.
Keep emergency stop and every safety function in their hardwired or safety-rated hardware. A bench test proves the tags and this one rung; it proves nothing about the machine's interlocks.
Recommendation: wire every HMI button to its own command bit and every indicator to its own status bit, latch with a seal-in rung in the PLC, and prove the pair on the bench with one lamp and both bits online; connect machine outputs only after the light follows the status bit through about 10 press cycles and an open permissive.
Questions
Does the HMI tag name have to match the ladder operand?
No. The name is a label for people reading the project. The tag's configured address and data type are what connect the object to the ladder, and they must match the operand the rung uses. Keep in mind that two objects pointed at the same bit react together: an indicator sharing the button's bit draws the button's state, whatever the machine is doing.
Why did a short press never show on the screen?
The command probably landed anyway. The panel sends the write as its own message when the button is pressed, and screen objects update on their poll cycle, so a tap shorter than one poll cycle can be invisible on the panel while the command bit still sets in the PLC. The seal-in rung is the cure: it turns a tap the screen may never display into a steady state the indicator cannot miss.
Can the HMI button energize the machine output directly?
Let it reach the output only through a ladder rung carrying the permissives and interlocks. The button writes a command bit; the rung decides whether the output follows. Emergency stop and every other safety function stay in their hardwired or safety-rated hardware, where no panel bit and no screen object belongs.
What data type should the button tag use?
A single bit, the smallest type the driver offers for that address. Many drivers can also reference one bit inside an integer word, using the syntax your PLC manual prints, and that works as long as the ladder scans the same word. A type mismatch usually shows as a tag that never changes, so match the type the program prints.
Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.