WinCC TIA v18 Enabling Single Bit Visibility on KTP1200 Basic

David Krause10 min read
HMI ProgrammingSiemensTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Problem Summary

When configuring a screen object (rectangle, ellipse, polygon, text field, or graphic view) in SIMATIC WinCC in TIA Portal V18 with a SIMATIC KTP1200 Basic panel, the Single Bit radio button in the Animations > Visibility dialog is unavailable (greyed out). The engineer is forced to use the Range option and supply a numeric value range such as 0..0 for "Invisible" and 1..1 for "Visible", even though the source tag Mr_Zr_ToggleSwitch is declared as a BOOL in the S7-1200 PLC data block.

When the Range option is applied as described, both the Visible range and the Invisible range receive the same numeric value pair (0..0 or 1..1), which causes the rectangle to remain visible at all states or to flash on every PLC cycle. The expected behaviour — visible when the Boolean tag equals 1, hidden when it equals 0 — cannot be configured through the standard Single-Bit selection on a Basic Panel.

Symptom in one line: Single Bit option greyed out in the Visibility animation dialog of a rectangle on a KTP1200 Basic HMI in TIA Portal V18.

Affected Hardware and Software

The behaviour is not a defect in the project, the PLC tag, or the panel firmware. It is a direct consequence of the runtime feature set bundled with the SIMATIC Basic Panels (2nd generation) compared with Comfort Panels and Unified Comfort Panels.

HMI Class Typical Models WinCC Engineering Visibility Animation Support
Basic Panels (2nd Gen) KTP400 Basic, KTP700 Basic, KTP900 Basic, KTP1200 Basic WinCC Basic (TIA Portal) Range only — single bit and dynamic dialog bit-options are not present.
Comfort Panels TP700 Comfort, TP900 Comfort, TP1200 Comfort, TP1500 Comfort, TP1900 Comfort, TP2200 Comfort WinCC Comfort/Advanced (TIA Portal) Single Bit, Range, Bit (0/1 direct)
Unified Comfort Panels MTP700 Unified, MTP1000 Unified, MTP1200 Unified, MTP1500 Unified, MTP1900 Unified, MTP2200 Unified WinCC Unified (TIA Portal) Bit, Range, JScript (Screen.Layers(...).Visible)

The TIA Portal V18 release notes for WinCC Basic confirm that the animation engine on Basic Panels was intentionally restricted to numeric range evaluation to keep the firmware footprint compatible with the ARM9-class controller used in the 2nd-generation Basic series.

Root Cause Analysis

The animation dialog shown in the screen editor is generated by the WinCC Configuration Studio plug-in matching the selected panel target. When the project device is a KTP1200 Basic, the configuration tool renders only the animation primitives supported by the WinCC Basic runtime image:

  1. Appearance (foreground / background colour via range)
  2. Visibility (range only)
  3. Position (X/Y, range)
  4. Size (range)
  5. Flashing (range-based bit pattern)

The Single Bit selection appears in the dialog only for Comfort and Unified panels because their runtime evaluates the animation expression as a Boolean directly. The Basic runtime instead interprets the configured value as an integer scalar and tests tag_value >= Lower && tag_value <= Upper. Because of this, the input must be a numeric tag (INT, WORD, BYTE, etc.), and the visible / invisible pair must define two non-overlapping integer ranges.

When the engineer binds the animation to a BOOL tag and selects Range, TIA Portal V18 implicitly maps the Boolean to 0 or 1 but will still accept only integer ranges as input. Configuring both Visible and Invisible with overlapping values (e.g. 0..0 for both) results in the runtime state machine staying in whichever range was evaluated last during the variable-update tick — the screen object therefore appears to be "stuck" on or off regardless of the toggle.

Why Both Ranges Cannot Be Identical

The Basic HMI runtime resolves animations once per tag-change event in the order Visible → Invisible. If the value simultaneously satisfies the Visible range and the Invisible range, the runtime honours the first match (Visible). Assigning identical ranges to both states is therefore semantically contradictory and produces indeterminate output.

Workaround 1 — Correct Range Configuration on Basic Panels

Because the Single Bit selection is unavailable, the supported and deterministic method is to declare two non-overlapping integer ranges and to keep the tag as a BOOL. TIA Portal V18 will perform the implicit BOOL → INT coercion at runtime.

Step-by-Step Procedure

  1. In the project tree, open the screen that contains the rectangle (default: Screen_1).
  2. Select the rectangle so that the Properties pane shows its configuration.
  3. Switch to Properties > Animations > Visibility in the right-hand pane.
  4. Click Add to insert a new visibility animation.
  5. Set Name = Visible, Trigger tag = Mr_Zr_ToggleSwitch (PLC tag of type BOOL).
  6. In the Range column, enter 1..1 and select the Visible state icon.
  7. Click Add a second time to insert the inverse animation.
  8. Set Name = Invisible, Trigger tag = Mr_Zr_ToggleSwitch (same tag).
  9. In the Range column, enter 0..0 and select the Invisible state icon.
  10. Compile the HMI (Project tree → HMI_1 → right-click → Compile > Software (rebuild all)).
  11. Download to the KTP1200 Basic (Online > Download to device > PG/PC interface).

The runtime will now evaluate the Boolean tag once per change. When the PLC writes TRUE, the 1..1 range matches and the rectangle becomes visible. When the PLC writes FALSE, the 0..0 range matches and the rectangle becomes invisible.

Verification in PLCSIM and the HMI Simulator

  1. In TIA Portal V18, launch PLCSIM (S7-1200/S7-1500) and start the simulation.
  2. Launch the HMI simulation (right-click HMI_1 → Start simulation).
  3. Force the tag Mr_Zr_ToggleSwitch in PLCSIM to TRUE: the rectangle must appear.
  4. Force the tag to FALSE: the rectangle must disappear.
  5. Toggle rapidly to verify that the screen update latency is below 250 ms (typical for a 100 ms acquisition cycle on Basic Panels).

Alternative Workaround — Promote BOOL to INT in the PLC

If the engineer prefers explicit numeric tagging or needs more than two states, change the PLC tag from BOOL to INT and adapt the HMI animation accordingly. The Boolean toggle can be implemented in SCL on the S7-1200:

// SCL example for S7-1200 / TIA V18
#VisibleState := BOOL_TO_INT(#Mr_Zr_ToggleSwitch);   // 0 or 1

The HMI then animates as follows:

Animation Trigger Tag Range Effect
Visible Mr_Zr_ToggleState (INT) 1..1 Show rectangle
Invisible Mr_Zr_ToggleState (INT) 0..0 Hide rectangle

This approach is the recommended pattern when more than two visibility states are required (for example, to show three rectangles in a state indicator).

Workaround 2 — Use the Single Bit Animation on a Comfort Panel

If the application can be migrated from a KTP1200 Basic to a TP1200 Comfort (same 12" form factor, same PROFINET interface, same TIA Portal V18 project), the native Single Bit animation becomes available and the configuration simplifies to a single tag binding.

  1. Replace the HMI device in the project tree: Devices & Networks → HMI_1 → Change device → TP1200 Comfort.
  2. Re-compile the HMI software. TIA Portal V18 will keep all existing screens, tags, and connections.
  3. Open the rectangle Properties > Animations > Visibility.
  4. Add a single animation, select Single Bit, bind it to Mr_Zr_ToggleSwitch, and check Visible when bit is set.
  5. Compile and download — the rectangle now toggles with a single Bool tag without the manual range pair.
Migration cost note: The Comfort Panel requires the larger WinCC Comfort/Advanced licence. Basic project images cannot be opened directly by Comfort; they are upgraded automatically during device change. Any Basic-specific objects (for example, the Basic text-field variant) are mapped to their Comfort equivalents.

Workaround 3 — Layer Visibility via JScript on Unified Panels

On SIMATIC Unified Comfort Panels (MTP series, WinCC Unified in TIA V18 and later), the screen object model exposes a JScript API that can drive visibility at runtime, including for whole Layers. This is the most flexible method because it does not require a per-object animation; a single script toggles an entire layer of objects.

The official Siemens documentation for TIA Portal V20 describes the runtime object model:

To make a layer visible in the current screen, use Screen.Layers("Layer_0").Visible = true;.
The Visible property changes the visibility of the layer in runtime.

Reference: Toggling the visibility of layers in runtime using the JScript function (TIA Portal V20 docs).

A complete event-driven implementation on a Unified Panel:

  1. Place the rectangle on Layer_0 in the screen editor.
  2. Create a Scheduled task or bind a tag-triggered event on the Mr_Zr_ToggleSwitch value change.
  3. Attach the following JScript function to the event:
// JScript for WinCC Unified, TIA V18+
function ToggleLayerVisibility(tagValue) {
    if (tagValue === 1) {
        Screen.Layers("Layer_0").Visible = true;
    } else {
        Screen.Layers("Layer_0").Visible = false;
    }
}

This method scales to many objects because a single layer visibility change hides or shows every object assigned to that layer — useful for indicator stacks, machine-state panels, or language-specific overlays.

Troubleshooting Matrix

Symptom Likely Cause Verification Step Fix
Single Bit radio button greyed out KTP1200 Basic (WinCC Basic runtime) Project tree → HMI_1 → Properties → Device Use two non-overlapping Range animations or migrate to Comfort
Rectangle stuck visible Both Visible and Invisible ranges contain 0..0 Inspect the Visibility animation table Set Visible = 1..1, Invisible = 0..0
Rectangle stuck invisible Tag update cycle too slow or wrong acquisition mode HMI tag properties → Acquisition cycle Set cycle to "On change" or ≤ 250 ms
Single Bit present but does not toggle Bit inversion flag set in animation Animation dialog → "Visible when bit is set" / "reset" Uncheck invert bit
Layer.Visible has no effect Object not assigned to the named layer Object properties → Layer assignment Move rectangle to Layer_0
JScript error "Screen is not defined" Script attached at wrong trigger (screen-open instead of tag-change) Event configuration → Trigger Attach to tag value-change event
Tag value visible in PLCSIM but HMI shows old state HMI connection not established or wrong PLC slot Online → Accessible nodes Verify PROFINET name, IP, and slot of S7-1200 CPU

Best Practice Checklist

  • Always keep the trigger tag as BOOL on the PLC side; the HMI handles the implicit conversion, and the S7-1200 program remains type-safe.
  • On Basic Panels, use the lowest practical acquisition cycle (100 ms is the minimum for animated visibility). Faster cycles increase CPU load on the ARM9 controller.
  • Never duplicate the same numeric range for both Visible and Invisible animations — the runtime honours only the first match.
  • If visibility logic grows beyond two states, move the project to Comfort or Unified Panels to take advantage of dynamic dialogs and JScript.
  • Document the layer naming convention (Layer_0, Layer_State_Active, etc.) in the project README so future engineers do not assign objects to the wrong layer.

Standards and Documentation References

The animation engine on SIMATIC panels is documented in the WinCC TIA Portal help system. The configuration steps and the JScript object model are covered in the Siemens TIA Portal Help (online manuals delivered with the installation) and the public TIA Portal V20 Unified documentation portal. For TIA Portal V18 specifics, the in-product help under Visualizing processes → Configuring animations lists the supported animation types per panel class.

FAQ

Why is the Single Bit option greyed out on my KTP1200 Basic panel in TIA V18?

The WinCC Basic runtime on SIMATIC Basic Panels (KTP400/700/900/1200 Basic) supports only range-based animation evaluation, not Boolean evaluation. The Single Bit radio button is only available for Comfort Panels (TP series) and Unified Comfort Panels (MTP series).

How do I toggle a rectangle's visibility with a BOOL tag on a KTP1200 Basic panel?

Add two animations in Properties → Animations → Visibility: one bound to the tag with range 1..1 selecting Visible, and a second bound to the same tag with range 0..0 selecting Invisible. The runtime will coerce BOOL to INT and toggle accordingly.

Why does my rectangle stay visible when both ranges are set to 0..0?

When Visible and Invisible ranges overlap, the runtime honours the first matching range in evaluation order. Identical ranges produce indeterminate behaviour. Use non-overlapping ranges (0..0 and 1..1) to obtain deterministic output.

Can I use JScript on a Unified Comfort Panel to toggle visibility?

Yes. On Unified panels (MTP700/1000/1200/1500/1900/2200), call Screen.Layers("Layer_0").Visible = true; or Screen.Layers("Layer_0").Visible = false; from a tag-triggered event script to toggle an entire layer in runtime.

Should I migrate to a Comfort Panel to keep the BOOL tag native?

If the project is at the design phase and only one or two visibility animations are needed, the Range workaround on the existing KTP1200 Basic is sufficient. For projects with many animations, dynamic dialogs, or scripts, migrating to a TP1200 Comfort or MTP1200 Unified panel is the more maintainable solution.

Back to blog