IMDTouchKnowledge BaseShop main store

Troubleshooting

Why an HMI toggle switch cannot write a physical PLC input

HMI and touchscreens Published 7 min read

Short answer

An HMI toggle cannot hold a physical input such as X1 on: the FX3U refreshes the X image from the field wiring at the start of every scan and wipes the write within one scan. Point the toggle at an unused internal bit such as M100, and OR that bit with the real X0 contact into the output coil so the HMI commands through logic instead of fighting the input refresh.

On this page
  1. Why a write to X1 can never hold
  2. Confirm the address before you change anything
  3. Point the toggle at an internal M relay
  4. Worked example: X0 contact OR M100 toggle bit drive Y0 on the FX3U
  5. Pick the button action on purpose
  6. If it still will not hold, find the second writer
  7. The decision for each case
  8. Questions asked

The toggle switch fails because of the address it writes, not because of the switch. X1 is a physical input: the FX3U re-reads every X address from the field wiring into the input image at the start of each scan, so a value the HMI writes there is overwritten within one scan cycle and the screen flips back. A momentary button aimed at internal memory works because nothing in the PLC rewrites memory between scans. The fix is two moves: point the toggle at an unused internal relay such as M100, and add one OR rung so the real contact and the HMI bit each drive the output. The sections below confirm the diagnosis from the screen side, walk the OR rung through a scan, and settle when to use momentary, toggle or latched action.

Why a write to X1 can never hold #

Mitsubishi's FX3S/FX3G/FX3GC/FX3U/FX3UC programming manual describes the FX scan as a repeating cycle: read the physical inputs into the input image, execute the program, write the outputs. The X area belongs to the read step. An HMI write is a communications service that lands between cycles, and the next input refresh stamps the real terminal state over it. The lifetime of a write to X1 is one scan, so the command cannot survive long enough to matter.

Whether a given HMI driver accepts the write or treats X as read-only, the outcome is the same: no hold. The screen makes it look worse. A toggle switch object in EasyBuilder Pro is a read/write bit object — it writes the address and then reads it back to draw the graphic — so the button redraws from the refreshed X state and appears to bounce straight off.

Confirm the address before you change anything #

Work down this list in order; it separates an address problem from a comms problem in under a minute:

  1. Open the switch object's properties in EasyBuilder Pro and read the PLC, device type and address it is set to — never the label drawn on the graphic.
  2. If the write address is an X device such as X0 or X1, that is the whole fault. Stop changing the action settings and retarget the button to an internal M relay.
  3. If it already targets an M relay, press the button and watch that bit online in the PLC programming software.
  4. If the bit follows your finger, the button and the link are good and the fault is downstream logic; build the OR rung below.
  5. If the bit turns on and clears by itself, check whether the button is set to momentary action, and cross-reference the bit for a PLC coil writing it.
  6. If the bit never moves, suspect the new button's address or the project's driver — a momentary button on internal memory that already works proves the cable, the station number and the write permission, so do not re-debug the link.

Point the toggle at an internal M relay #

An operator request belongs in internal relay memory, and the field wiring owns X. Pick a number the program never touches; on this machine the working fix uses M100. In EasyBuilder Pro, select Toggle Switch from the Object menu and set its read/write address to M100, then leave the graphics alone — the object type and animation were never the problem.

The screen bit does nothing by itself. The program has to consume it, which is what the next section wires up.

Worked example: X0 contact OR M100 toggle bit drive Y0 on the FX3U #

Inputs #

  • X0 — the physical pushbutton wired to input terminal X0 of the FX3U-128M, read through the input image each scan.
  • M0 — an internal relay the program uses as its own copy of X0.
  • M100 — the HMI command bit the toggle switch writes; its only writer must be the HMI, which the cross-reference step confirms.
  • Y0 — the output coil that either source may energize.

The rule in words #

Y0 is on when the physical contact is closed OR the HMI bit is on. The field wiring writes only X0, the screen writes only M100, and the program alone writes M0 and Y0 — no device has two masters.

The rung and the scan #

LD X0
OUT M0
LD M0
OR M100
OUT Y0

Rung one copies X0 into M0 every scan; rung two energizes Y0 when M0 or M100 is on. Follow one toggle press through the cycle:

  • Touch the toggle: the HMI writes M100 = 1.
  • Next scan, input refresh: pushbutton open, so X0 = 0 and rung one computes M0 = 0.
  • Rung two: M0 (0) OR M100 (1) = 1, so Y0 = 1 and the output refresh switches the Y0 terminal on.
  • Touch the toggle again: M100 = 0, and the following scan computes Y0 = 0.
  • Press the real pushbutton instead: X0 = 1 makes M0 = 1 and Y0 = 1 no matter what M100 holds — the two command sources stay independent.

The result: the screen command holds for exactly as long as M100 is set, because nothing in the scan cycle rewrites M100. Prove it on the bench by watching M100 and Y0 online through a full press-and-release cycle.

Result and decision #

Assign M100 only after the programming software's cross-reference shows no coil, SET or RST on it. If anything in the program writes M100, choose a different unused number: the OR rung works only when the HMI is the bit's only writer.

Pick the button action on purpose #

Decide what releasing your finger must do before you draw the object:

  • Momentary (held): on while pressed, off on release. This is the correct action for run-while-held requests — a momentary bit on M100 built into the output rung, not a toggle at an X address.
  • Maintained (toggle): each touch flips the bit. Use it for mode selections that should persist.
  • PLC-latched: a short pulse from the screen drives a SET in the PLC, cleared by a defined reset path in the program.

Two pairings to avoid: a momentary button plus a SET instruction is not hold-to-run, because the latch stays on after the touch ends; and a toggle cannot substitute for a momentary button where the output must be energized only during the touch. Read the bit online through a complete press-and-release cycle — the graphic is not evidence of the PLC state. The wider behavior of driving a PLC bit from a screen toggle is covered in Toggling PLC BOOLs from HMI screens across the display boundary, and the button can be proven before it goes on the machine by testing HMI simulation against a live PLC as in Testing HMI Simulation Against a Live PLC.

One limit that outranks the rest: a touchscreen command over ordinary communications is not a safety-rated hold-to-run device. Where release must reliably stop motion, that stopping function belongs to the machine's validated safety design, not to an HMI bit.

If it still will not hold, find the second writer #

  • Cross-reference M100 and Y0 in the programming software. Contacts only read a bit; coils, SET, RST and their equivalents own it. Any writer on M100 competes with the screen.
  • The classic conflict is an input-copy rung, LD X0 / OUT M0, with the HMI also pointed at M0: every scan where X0 is open, the copy rung rewrites M0 off and the screen command dies with it. Keep the copy bit and the HMI request on different devices — that is exactly why the example puts the copy on M0 and the request on M100.
  • An ordinary OUT coil follows its rung on every scan, while SET holds until RST clears it. Swapping OUT for SET changes release behavior; it does not fix an address-ownership problem.

The decision for each case #

  • Keep an input on with a screen switch: not at X1 — the input refresh wins every scan. Retarget the toggle to an unused M relay such as M100 and OR it into the logic, as the worked rung above shows.
  • Run a coil while the touch is held: momentary action on that same M bit, consumed by the output rung through the OR. Both cases share one rule: the HMI commands through an internal bit, and the ladder decides what the hardware does.

Questions asked

Can I force an X input on with programming software instead of the HMI?

Yes, as a commissioning aid only. A forced contact in the PLC programming software holds the bit regardless of the field wiring, because the force acts on the input image itself. That is exactly why it is dangerous left on: the machine believes an input that does not exist. Use forces to prove logic during commissioning, then clear every force and confirm the force indicator is off before the machine runs.

Will the M100 command bit stay on through a power cycle?

No. M100 sits in the FX3U's default non-latched relay range, so the bit clears whenever PLC power is removed. If the command must survive a restart, either move the HMI bit into a latched range or extend the latch ranges in the PLC parameters. A latched command still needs a deliberate reset path in the program, or the operator cannot turn the request back off.

Does the same rule apply to writing outputs from the HMI?

Yes. A write to a Y output lasts only until the program's next executed coil on that address and the output refresh. If a rung drives Y0 on every scan, it overwrites whatever the HMI wrote. Treat outputs like inputs in this respect: the screen gets its own M bit, and the ladder builds that request into the output rung.

How do I pick an M number the program is not already using?

Use the cross-reference or device usage list in the PLC programming software: it lists every device in the project and how it is used. Any M number with a coil, SET or RST already writing it is taken. An M number that appears only as a contact is risky too, so the safest choice is a number that does not appear anywhere until your OR rung adds it.

Keep reading

  • Troubleshooting

    Why an HMI Macro PLC Tag Is Missing From the PLC Program

    Only the second quoted string in a macro line is a candidate PLC tag, and it resolves against the HMI Address Tag Library, which maps the name to a controller address. Unquoted names are macro-local variables that never reach the controller. If no HMI unit sits in the data path, trace the real consumer from the controller's cross-reference and Ethernet client list.

    HMI and touchscreens

  • Troubleshooting

    Why an HMI Writes Integers but Not B3 Bits Over DF1

    When an HMI writes T4, C5 and N7 data but B3 bits never change over DF1, the serial link is proven and the failure sits in the HMI software's binary-file translation. Check the engineering software version before baud, cable or PLC settings: a documented case was fixed by upgrading EBplus from 2.10 to 5.07.

    HMI and touchscreens

  • Troubleshooting

    Diagnosing intermittent HMI to PLC Ethernet comms hangs

    Stop changing the topology. Put one packet capture where it can see the PLC-to-HMI unicast exchange — a mirror port or a tap, not a spare switch port — run it through at least three hangs with device logs on the same clock, set every panel update cycle to 1000 ms, and confirm the three devices hold unique IP addresses. Whether panel requests stop or PLC responses disappear decides which side you repair.

    HMI and touchscreens

How to Run makepic for Crimson 2.0 CompactFlash Images