Explainer
Why WinCC button visibility needs one PLC bit for two conditions
Short answer
A WinCC Comfort or Basic panel's visibility animation references one controlling tag, so you AND the two conditions in the PLC and bind that single Boolean result to the button. Unified, V7 and Professional editions can also evaluate both tags HMI-side. The overlay-rectangle and multiplex-tag workarounds are not acceptable substitutes for one PLC bit.
On this page
- Can a WinCC button be visible only when two tags are true?
- Why does the visibility animation on Comfort and Basic panels accept only one tag?
- How do I AND the two conditions in the PLC?
- How do I connect the PLC result to the button's visibility?
- Should I use a script, an overlay rectangle or a multiplex tag instead?
- Does hiding the button stop the operator from operating the machine?
- How do I test all four input combinations?
- Questions asked
You want a button that appears only when two conditions are true at the same time. On a WinCC Comfort or Basic panel the visibility animation takes a single controlling tag, so the clean answer is one PLC instruction: AND the two conditions in the controller and connect that Boolean result to the button. WinCC Unified, the V7 line and Professional can also combine the tags on the HMI side, through expressions or scripts. What you should not do is cover the button with a background-colored rectangle or route the logic through a multiplex tag; both hide the requirement instead of implementing it. Below is the mechanism, the PLC logic, the tag binding and the commissioning test.
Can a WinCC button be visible only when two tags are true? #
Yes: on a WinCC Comfort or Basic panel the visibility animation is bound to a single controlling tag, so you AND the two conditions in the PLC and connect that one Boolean result to the button; Unified, the V7 line and Professional can also evaluate the combination HMI-side. Identify the engineering tool and the runtime target before choosing a mechanism, because the property editors differ between editions. In WinCC Unified you select the object property in the Expressions tab and dynamize it with one expression that references both tags, which is the supported HMI-side route there. Some other HMI packages take a Boolean expression directly in the visibility field, for example building an A and not B visibility condition in EasyBuilder Pro. What another package's property editor accepts proves nothing about the panel in front of you; the installed edition and the object's own properties are the authority.
Why does the visibility animation on Comfort and Basic panels accept only one tag? #
Because that editor dynamizes visibility through a tag connection to one tag, with visible or hidden assigned to ranges of that tag's value; it has no expression field, so two independent tags cannot be referenced in one animation. The documented sequence is: select the screen object, open the Inspector window under Properties > Animation, and add a Tag connection for the object's visibility. You may stack several ranges on that one tag — an integer from 0 to 10 can show the object at 4 and hide it elsewhere — but the dialog still references a single tag. That is the whole reason the combination has to exist as one value before it reaches the panel. How the panel then draws or removes the object as the tag changes is covered in how WinCC visibility animations hide and show objects at runtime.
How do I AND the two conditions in the PLC? #
You write one Boolean in the PLC that is the AND of the two conditions, assigned on every scan so it can never latch true: four input combinations exist, and only the one with both conditions true makes the button visible. Define each condition positively first — if the requirement is "no fault", invert the fault bit before the AND so the logic reads like the requirement. Worked example: AutoMode and PumpFeedback are Bool inputs, both initially false, and PumpStartBtnVis is the Bool result, initially false, assigned unconditionally every scan:
PumpStartBtnVis := AutoMode AND PumpFeedback;
| AutoMode | PumpFeedback | Arithmetic | PumpStartBtnVis | Button |
|---|---|---|---|---|
| 0 | 0 | 0 AND 0 | 0 | hidden |
| 0 | 1 | 0 AND 1 | 0 | hidden |
| 1 | 0 | 1 AND 0 | 0 | hidden |
| 1 | 1 | 1 AND 1 | 1 | visible |
Two rules keep it honest: the assignment must execute on every scan of the logic, and no other routine may write the same variable. A set-coil that writes true without a matching reset leaves the button on screen after a condition disappears, which is the classic field failure on this function. Keep the result in the same program block as the conditions so the next technician finds the whole requirement in one place.
How do I connect the PLC result to the button's visibility? #
You create one HMI tag of data type Bool, connect it to the PLC result through the panel's controller connection, and bind it to the button's visibility with false mapped to hidden and true mapped to visible. Check the polarity in the animation dialog instead of assuming a default, because a reversed mapping shows the button exactly when it should vanish. The step-by-step binding of a single PLC bit is walked through in showing an HMI button only when a PLC bit is high. Then compile and load the changed screen; the runtime shows the loaded project, not the one open on your engineering laptop. If the PLC result changes but the button does not, split the diagnosis: first prove the panel receives the changing value — put the tag on a test field or watch it with the panel's online tools — then inspect the visibility mapping and confirm you edited the button that is actually on the displayed screen.
Should I use a script, an overlay rectangle or a multiplex tag instead? #
No: an overlay rectangle depends on screen background, layering and touch handling, a multiplex tag adds an indirect addressing layer to what is a single AND operation, and a script must be triggered by changes of both tags; the PLC bit beats all three. The rectangle trick — parking a background-colored box over the button, driven by the second condition — works only until the background becomes a graphic, the theme changes or the layering is reordered, and to actually block operation the rectangle must also swallow touches.
Multiplex tags exist for faceplates, where one tag interface serves many instances; a multiplex tag pattern for faceplate visibility solves that per-instance problem, not the combination of two machine conditions. Scripts on editions that support them are legitimate, but each input needs its own trigger and the logic then lives in two tools. Use the HMI-side expression only where the edition documents it and the conditions exist solely on the HMI; otherwise the controller instruction is smaller, testable in one place, and identical on every target.
Does hiding the button stop the operator from operating the machine? #
No: visibility is presentation only, so if the two conditions also govern whether the action is allowed, the PLC command logic must evaluate the same conditions and reject the command when they are false. Hiding a button never replaces a permissive. As a second layer on the HMI, drive the object's enable property from the same result bit so the button refuses input in the moment before the screen redraws; the pairing of the two properties is shown in enabling object access on a KTP700 Basic Panel with visibility. The controller check is the one that matters: an operator with a function key or another screen can always reach the write, and only the PLC decides whether it executes.
How do I test all four input combinations? #
You force each combination in order, hold one condition true while toggling the other, and confirm the button hides again when either input drops: all four rows of the truth table must match on the running panel. Do it on an isolated bench or with the machine in a safe state, using the real tags rather than substitutes, and watch the PLC result and the displayed state at the same time. The screen follows the panel's acquisition cycle, so a brief delay between the bit changing and the button moving is normal; read the configured acquisition cycle before calling it a fault. On Unified, change each input separately while the other stays true — a single both-true test cannot expose an expression that tracks only one tag; if a Unified visibility binding stops following its tag, work through resolving visibility tag animation failures on Unified panels.
The decision, case by case:
- Comfort or Basic panel: PLC AND, one Bool bound to visibility.
- Unified: an expression on both tags, or the PLC bit when the controller needs the same permissive.
- V7 or Professional: the edition's script or dialog dynamization, or the PLC bit.
- Overlay rectangle or multiplex tag: never for this job.
Questions asked
Can I script the combination on a WinCC Basic Panel instead of using the PLC?
No. Basic Panels offer no script function at all, so the PLC AND is the only route that reaches the screen. Comfort Panels do have a script editor, but the script must be triggered by changes of both tags, which doubles the trigger configuration and still leaves the logic split between two tools. The controller instruction is smaller and testable in one place.
How many result bits do I need when several buttons each depend on a different pair?
One for each distinct pair. Two buttons that depend on the same two conditions read the same result bit, so five buttons with three different pairs among them need three bits. Give each result a name that states its pair, and keep them in the same program block as the conditions so a later reader finds the logic in one place.
Can I pack both conditions into one integer tag instead of a Boolean?
Yes, and it stays within the one-tag limit. Write an integer in the PLC where the first condition adds 1 and the second adds 2, then set the visibility range to show the button only at the value 3. Both conditions true gives 1 plus 2 equals 3, a single condition gives 1 or 2, neither gives 0. It costs more PLC work than the plain AND, so use it only when the individual states must also be distinguished on the screen.
Will the PLC result survive a later migration to WinCC Unified?
Yes, unchanged. The bit is a controller variable, so Unified, Professional or any other HMI that reads the PLC can bind it directly, while an HMI-side expression or script written for one edition has to be rebuilt for the next. That portability is the main reason to keep the combination in the PLC even on editions that could evaluate both tags themselves.