IMDTouchKnowledge BaseShop main store

Troubleshooting

Toggling PLC BOOLs from HMI screens across the display boundary

HMI and touchscreens Published 8 min read

Short answer

An HMI button cannot toggle a Programming BOOL by name because Display and Programming are separate applications. Exchange the value through a commissioned register: define it in Commissioning, connect it to the BOOL in Programming, and drive it from Display with a bound field or a Video_SetParam and Video_GetParam event procedure, then verify with two presses per control.

On this page
  1. Why can't my HMI button toggle a PLC BOOL variable?
  2. Why does my Display procedure fail to compile with "Object not found"?
  3. Why can't Programming find the BOOL I declared in Display?
  4. Why is the checkbox greyed out on my HMI screen?
  5. How do I map a commissioned register to a PLC BOOL?
  6. How do Video_SetParam and Video_GetParam toggle the register?
  7. How do I verify the toggle reaches the PLC at runtime?
  8. Which side wins when the HMI and the PLC both write the BOOL?
  9. Questions asked

An HMI button in EcoStruxure Machine Expert - HVAC cannot toggle a Programming BOOL by name, because the Display tab and the Programming tab build two nearly independent applications, and no variable declared in one is visible to the other. A Display procedure that references the Programming variable stops the build with Object not found, and a global BOOL declared in Display toggles the screen while the controller never sees it. The value crosses the boundary only through a commissioned register: define it in Commissioning, connect it to the BOOL in Programming, then drive it from Display with a bound field or a Video_SetParam and Video_GetParam event procedure. On an M172PDG42R project at Machine Expert - HVAC version 1.7.0, that mapping put eight screen-button toggles into service.

Why can't my HMI button toggle a PLC BOOL variable? #

Your button cannot reach the BOOL because the Display tab builds an HMI application and the Programming tab builds the controller application as nearly independent code, and the only path between them is a commissioned register that both sides reference.

In practice this means two code environments that never share a symbol table: the Display tab draws and animates the screens, the Programming tab runs the controller logic in the platform's IEC 61131-3 style languages, and the linkage between them is a communication layer that exchanges data through registers — the ones you define in Commissioning, or the predefined shared registers the platform already provides. Identical spelling on both sides does not merge them into one variable; it declares two variables that never meet.

Your analog values already prove the path works: they arrive as registered points and reach the screen as scaled values, the same exchange described in scaling a PLC integer into an HMI display value. The BOOL failed only because nothing had mapped it.

Decision: give the BOOL its own commissioned register instead of hunting for a way to share the name.

Why does my Display procedure fail to compile with "Object not found"? #

The Display compiler rejects a Programming variable because that symbol lives in the controller's namespace, not the HMI editor's symbol table, so a procedure in the Events tab fails before runtime with Object not found while the identical name compiles fine inside Programming.

That error is a namespace failure, not a syntax fault and not a communication fault. The Events-tab procedure asks the Display compiler to resolve a name the HMI project has never declared, the compiler finds nothing, and the build stops before anything downloads. Renaming the variable, retyping it or moving the procedure does not help, because the symbol genuinely does not exist on that side. The same reference compiles without complaint inside Programming, which confirms the diagnosis.

Decision: reference something the Display compiler can actually see — a register address — and let the communication layer carry the value to the BOOL.

Why can't Programming find the BOOL I declared in Display? #

A global BOOL declared in Display is global only inside the HMI application, which is why the procedure toggles it on screen while the Programming tab has no symbol by that name; identical spelling across the two tabs creates two separate variables.

The Display-side global still has a legitimate use: toggling it from the procedure proves the event fires and the screen logic executes, which isolates the remaining problem to the missing exchange with the controller. It never becomes a control path, because no register moves and no Programming code can resolve the name.

Decision: keep a Display-only BOOL for screen-internal state and test lamps, and use a commissioned register whenever the machine has to react.

Why is the checkbox greyed out on my HMI screen? #

The checkbox object stays greyed out on this target even though the documentation lists it, and no documented reason or setting changes that; the practical decision is to stop chasing it and use an available button plus an event procedure against the register.

A button with an event procedure performs the identical function: each press writes the Boolean state to the commissioned register through Video_SetParam, and a variable field linked to the same register beside it shows the live state. The checkbox is a convenience, not a requirement, and the control path is complete without it. The physical keys beside the display can also be configured as toggles over the same register-backed path.

Decision: build the toggle from a button plus event procedure now, and revisit the checkbox only if a later software version enables it on your target.

How do I map a commissioned register to a PLC BOOL? #

Give every controlled BOOL its own commissioned register: one register per BOOL, defined in Commissioning, connected in Programming, and bound or addressed from Display, so eight toggle controls need eight distinctly mapped registers with no shared or copied address.

Work through the four layers in order and confirm each one before moving to the next:

  • Commissioning — define or select one register per BOOL and record its configured name and address, so the register is identifiable unambiguously from both project areas.
  • Programming — connect each BOOL, or its command path, to its assigned register, and keep interlocks, permissives and output logic in the Programming application.
  • Display — bind the screen control to the same register or address it from the event procedure; the Display build must finish with no Object not found.
  • Runtime — read the register back after every command, and require the displayed state to agree with the PLC state.

A BOOL and a register are different data types, so a bit mapped into a wider register crosses a type boundary — the same class of fault as resolving a BOOL to INT address boundary error on other controllers — and the mapping, not the spelling, decides which bit the screen actually sees. Compile both the Display and Programming portions after the mappings are complete.

Decision: do not start runtime testing until both builds pass with all mappings in place.

How do Video_SetParam and Video_GetParam toggle the register? #

Call Video_GetParam to read the register's current state, invert it, and call Video_SetParam to write the opposite state back to the same register address inside the button's event procedure, always passing the commissioned register address rather than a Programming variable name.

Both functions live in the HMI editor and exchange the register value on command, which makes the transfer event-driven instead of continuous. A press-toggle must read before it inverts: if Video_GetParam fails or is skipped, Video_SetParam flips a stale screen value rather than the controller state, so confirm the read succeeded before writing.

The address can be hardcoded in the procedure, or the PAR_ADR input can resolve it from the configured register name. Name-based resolution removes duplicated address entry, but the name must match the Commissioning definition exactly — PAR_ADR resolves registers, it does not make a Programming variable visible to Display code.

Decision: use direct binding when the value should exchange continuously, and the function pair when the write should happen only on press.

How do I verify the toggle reaches the PLC at runtime? #

Prove each mapping with two presses per control: press once and confirm the register and the PLC BOOL both go true, press again and confirm both return false, which gives sixteen press tests for the eight-BOOL application described here.

Run this sequence per control:

  1. Monitor the mapped register and the PLC BOOL together and record their initial states before touching the screen.
  2. Press the control once: the intended register changes and no neighboring register moves.
  3. Confirm the Programming logic receives the request; if an interlock rejects it, the screen must show the accepted PLC state, not the requested one.
  4. Press again and confirm the reverse transition. A one-way result points at a wrong address, missing write access, or the PLC overwriting the bit.
  5. Repeat for every mapped control, then operate several in sequence to expose copied addresses or shared bindings.

Worked example, eight BOOLs: 8 controls × 2 presses = 16 press tests. Each press is observed at 2 points, register plus PLC BOOL, so 16 × 2 = 32 state checks. Adding the 8 initial-state readings before the first press gives 32 + 8 = 40 total observations. Cloning a working control and assuming its binding changed is how duplicates survive, so all 8 name-to-address-to-BOOL mappings are verified individually, and the same press-and-readback discipline applies when testing an HMI simulation against a live PLC before the hardware run.

Decision: sign off a control only after both of its transitions pass.

Which side wins when the HMI and the PLC both write the BOOL? #

Let the PLC win: the HMI writes a request into the register, the Programming logic applies its interlocks and decides the accepted state, and the screen displays the accepted state read back from the controller, never the requested state.

A toggle written as read-invert-write loses any PLC update that lands between the read and the write, so a bit that can start or stop powered equipment belongs behind those Programming-side interlocks, not in place of them. The HMI proposes, the controller decides, and the operator sees what the machine actually did — the same operator-feedback habit behind designing HMI screens for clear operator decisions.

Decision: for interlocked equipment the controller owns the BOOL and the screen proposes; never let both sides write the final state.

Questions asked

Do predefined shared registers work like the ones I define in Commissioning?

Yes. Both kinds travel the same communication layer and both cross the Display-Programming boundary; the difference is who defines the address point. A register you define in Commissioning carries your own name and mapping, while a predefined shared register comes with a fixed address from the platform's register list. Either works for a toggle as long as the controller side and the screen side reference the same point, so confirm the definition before you reuse one.

Can the physical keys next to the display act as toggles?

Yes. A physical key such as the Left button beside the display can be configured as a toggle, and it follows the same rule as an on-screen control: the key event must still reach the PLC BOOL through a commissioned register rather than a Display-only variable. Configure the key in the display editor, point it at the same register mapping, and prove it with the same two-press readback test.

Why do my analog values cross the boundary while my BOOL does not?

Because those analogs were already set up as registered points when you commissioned them, and the screen edits prove the write direction of that path works. The BOOL was never registered, so it had no path to travel. Register it — one commissioned point, connected in Programming and referenced from Display — and it uses the same exchange the analogs already use.

What symptom reveals that two buttons were cloned onto one register?

Pressing either control moves the same BOOL, the second BOOL never changes state, and the register readback shows one address tracking both controls. It usually comes from copying a working screen object and editing only its label. Check the address behind each control against the Commissioning list, correct the duplicate, and repeat the two-press test on the repaired button.

Keep reading

  • Troubleshooting

    Why HMI Indicators Stay Off Over Modbus RTU Polling

    Indicators on internal tags animate from HMI memory with no serial traffic; an indicator bound to a PLC tag needs a completed Modbus RTU read of the right address in the right data area. Confirm the PLC bit changes, then read the request and response, then fix the address at one known point.

    HMI and touchscreens

  • How-to

    How to Scale a PLC Integer Into an HMI Display Value

    Divide the raw integer by 100 in an expression on the HMI variable and set the numeric field format to two decimal places: a register value of 4998 then displays as 49.98. The scaling tab rounds because its result stays an integer, which cannot carry a fraction; the expression evaluates the division as a real value before the field renders it.

    HMI and touchscreens

  • How-to

    Displaying S7-200 Analog Inputs on a WinCC HMI

    Copy the channel word into V-memory with LD SM0.0 and MOVW AIW0,VW1000, put the CPU in RUN, then read VW1000 with a WinCC tag typed as a 16-bit integer and bind it to a numeric field. Four readings — channel word, destination word, tag, display — isolate any fault; the first one that fails names the layer to fix.

    HMI and touchscreens