WinCC Comfort/Advanced Axis Screen Multiplexing with UDTs

David Krause14 min read
HMI ProgrammingSiemensTutorial / How-to
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

Overview

When an HMI project must visualize many similar subsystems—positioning axes being the canonical example—copying one screen per axis and renaming ~40 tags per copy does not scale. Three axes today become ten tomorrow. WinCC Comfort/Advanced provides three production-grade solutions that eliminate duplication: tag multiplexing on the HMI side, UDT-based faceplates introduced from TIA Portal V13 SP1, and PLC-side BLKMOV multiplexing. This reference covers the wiring of all three, the trade-offs, and the verification steps required before commissioning.

The discussion uses a positioning axis with the tag set below. The same pattern extends to any collection of similar structures (valves, drives, pumps, stations).

Table 1 - Reference axis tag list (per axis instance)
Tag (per axis) Direction Data type Purpose
Axis_X.Move_Forwards HMI → PLC Bool Jog positive command
Axis_X.Move_Backwards HMI → PLC Bool Jog negative command
Axis_X.ActualPosition PLC → HMI Real / LReal Position feedback
Axis_X.ActualVelocity PLC → HMI Real Velocity feedback
Axis_X.SetpointPosition HMI → PLC Real Position setpoint
Axis_X.StatusWord PLC → HMI Word / UInt Status bits
Axis_X.ErrorWord PLC → HMI Word Error bits
Axis_X.Home HMI → PLC Bool Homing trigger
Axis_X.InPosition PLC → HMI Bool In-position flag
Axis_X.SWLimitPos PLC → HMI Bool Positive SW limit reached
Engineering rule: encapsulate every per-axis tag inside a PLC UDT named, for example, typeAxis. All axis DBs become instances of that UDT. The HMI then binds to UDT members instead of absolute addresses, which is the prerequisite for faceplate reuse and is the recommended structure under V13 SP1 and later.

Prerequisites and Engineering Environment

Table 2 - Required toolchain
Component Minimum version Notes
TIA Portal V13 SP1 (UDT + faceplate support) or V14+ Faceplates require Comfort/Advanced V13 SP1 or later
STEP 7 Bundled with TIA Portal Authoring SCL for BLKMOV block
WinCC Comfort/Advanced V13 SP1 or later Comfort panels for ≤ 15"; Advanced for PC runtime
PLC S7-1200 / S7-1500 / S7-300 / S7-400 UDT available on all; faceplates work with any UDT-capable PLC
HMI tag license Standard WinCC tag count Multiplexing does not reduce tag license consumption; one multiplexed tag still counts as a configured connection

Reference manuals to keep open while configuring:

Architecture Decision: Multiplexing vs. UDT Faceplates vs. PLC-Side BLKMOV

All three approaches remove the "one screen per axis" duplication, but they differ in scalability, commissioning effort, runtime behavior, and debuggability. Choose before you wire a single tag.

Table 3 - Comparison of axis-screen architectures
Criterion Tag Multiplexing (HMI) UDT + Faceplate PLC-side BLKMOV
Required TIA Portal version V13 or later V13 SP1 or later Any (STEP 7 Basic supported)
Number of HMI tags consumed One per variable, independent of axis count One UDT instance per axis One multiplex tag for command + status per variable
Screen count for N axes 1 1 (faceplate instance per axis) 1
Selection trigger Index tag (INT) from PLC or HMI UDT instance name Index INT from HMI, moved on the PLC
Cyclic load on HMI Higher (multiplex requires update event) Low (direct UDT access) Lowest (PLC does the heavy lifting)
Scalability to 50–100 axes Acceptable; degrades as tag count rises Excellent Excellent
Ease of debugging Moderate; must trace which index is active High; watch window shows UDT members High; multiplexer FB is a single block
Limitation Only available for tag-prefixed structures Requires UDT discipline on PLC side Adds a scan-time cost on the PLC
Recommended for 2–10 axes, mixed tag names 3–500 axes, modern projects 10–100 axes, drive-heavy projects
Field-proven recommendation: if your project is at V13 SP1 or later, use UDTs on the PLC and faceplates on the HMI. That combination is the one Siemens explicitly documents in entry 68014632, and it survives a project expansion from three axes to one hundred axes without restructuring.

Option 1 - Tag Multiplexing in WinCC Comfort/Advanced

Mechanics of the Multiplex Property

Tag multiplexing substitutes a configurable prefix for the leading characters of a tag name, selected by an index tag. When the index tag changes value, every multiplexed tag re-resolves its address. For WinCC Comfort/Advanced this requires:

  1. The HMI tags that participate in multiplexing must share a common prefix (e.g., Axis_A_, Axis_B_, Axis_C_).
  2. An index tag of type Int is created with the property Multiplex enabled.
  3. The remaining tags reference that index tag in their Multiplex tag field.
  4. The index tag must be sourced from a PLC connection or a script; it cannot be a local tag if it must follow axis selection on the PLC side.

Step-by-Step Configuration

  1. Build the tag naming convention on the PLC side. Create one DB per axis (DB_Axis_A, DB_Axis_B, DB_Axis_C) with identical member names (Move_Forwards, ActualPosition, …). DB numbers must differ; names must match.
  2. Open the HMI tag editor in TIA Portal and add the three DB tags from DB_Axis_A. Name them Axis_A_Move_Forwards, Axis_A_ActualPosition, and so on. Repeat for B and C, keeping the variable suffixes identical.
  3. Add the index tag. In HMI tags, create Selected_Axis of type Int with the PLC connection pointing to, e.g., DB_HMI.DB_SelectedAxis. In the Properties pane under Settings, check Multiplex tag.
  4. Multiplex the remaining tags. Open Axis_A_ActualPosition, navigate to Properties → Multiplex, and bind the field to Selected_Axis. The prefix Axis_A_ is replaced by Axis_B_ when the index changes. Repeat for every tag.
  5. Wire the index from the HMI. On the screen, add an I/O field bound to Selected_Axis or use an axis selector button that writes the index (1 for A, 2 for B, 3 for C) into DB_HMI.DB_SelectedAxis.
  6. Author the screen once. Drag Axis_A_Move_Forwards, Axis_A_ActualPosition, etc., onto a single "Axis" screen. At runtime, the screen reflects whichever axis Selected_Axis points to.

Limitation: Cyclic Index Polling and Update Behavior

Important: multiplexed tags update only when the index tag changes value or when a configured update event fires. If Selected_Axis remains constant while an underlying axis variable changes, the HMI value still refreshes through the normal acquisition cycle—but selecting an axis for the first time may show stale data until the index tag is acknowledged by the HMI. Always configure an explicit Update event on the multiplex tag (e.g., on PLC tag change) and verify in the HMI trace that the index transition triggers a re-acquisition.

For full mechanical detail, see the Siemens knowledge base entry 21807421 - How does tag multiplexing work.

Option 2 - PLC UDT and WinCC Faceplates (Recommended from V13 SP1)

Defining the Axis UDT in the PLC

A UDT encapsulates the axis tag list once. Every axis becomes a typed instance:

  1. In the PLC project tree, right-click PLC data types → Add new data type; name it typeAxis.
  2. Declare all 40 members exactly as they exist per axis.

TYPE "typeAxis"
VERSION : 0.1
  STRUCT
    Move_Forwards : Bool;
    Move_Backwards : Bool;
    Home : Bool;
    ActualPosition : LReal;
    ActualVelocity : Real;
    SetpointPosition : LReal;
    StatusWord : UInt;
    ErrorWord : Word;
    InPosition : Bool;
    SWLimitPos : Bool;
    SWLimitNeg : Bool;
  END_STRUCT;
END_TYPE
  1. Create one DB per axis that references the UDT: DB_Axis_A, DB_Axis_B, DB_Axis_C—all of type Array[1..3] of "typeAxis" or separate DBs of type typeAxis.

Creating the Axis UDT on the HMI Side

The HMI UDT mirrors the PLC UDT one-to-one. This is the manual step that V13 SP1 introduced; earlier versions required copy-paste tags per axis.

  1. In the HMI project tree, open PLC data types → Add new data type; name it UDT_Axis.
  2. Declare exactly the same members as on the PLC side, with matching names and data types.
  3. Add three HMI tags of type UDT_Axis, named Axis_A, Axis_B, Axis_C, each pointing to the corresponding PLC DB.

Authoring the Faceplate

  1. In the HMI screens library, create a new faceplate named fpAxis.
  2. Add the I/O elements to the faceplate body: two jog buttons bound to Axis_X.Move_Forwards and Axis_X.Move_Backwards, a numeric output bound to Axis_X.ActualPosition, a status indicator bound to Axis_X.InPosition, etc. Use the placeholder Axis_X exactly as Siemens documents in entry 68014632; TIA substitutes the UDT instance name at placement time.
  3. Define the faceplate interface: properties for tag-instance selection, events for command buttons.
  4. Compile the faceplate.

Wiring the Faceplate to a Screen

  1. Open the Axis overview screen.
  2. Drag fpAxis from the library three times. On each drop, set the Tag instance property to Axis_A, Axis_B, and Axis_C respectively.
  3. Place a master "Selected axis" I/O field bound to a single INT tag; use a script or button event to write 1/2/3 to that tag.
  4. Bind a screen-level indicator (e.g., border color) to (Selected_Axis == 1), == 2, == 3 so the operator sees which axis is currently "live".
Advantage over multiplexing: the faceplate shows all axes simultaneously because each instance is a separate tag. With multiplexing, only one axis is visible at a time. For drives, this is the decisive factor—operators almost always want to see all three positions side by side.

Option 3 - PLC-Side Multiplexing via BLKMOV (Industrial Strength)

For projects that must scale to 50–100 axes or that need rock-solid deterministic refresh, the multiplexing happens on the PLC side. The HMI binds to a single command and status structure; the PLC copies data between the selected axis and that structure using BLKMOV (S7-300/400) or MOVE_BLK (S7-1500 SCL). This approach avoids HMI-side multiplexing load and is the preferred pattern for drive-heavy machines.

Data Blocks Required

  • DB_Axis[1..N] – array of UDT instances.
  • DB_HMI_Cmd – the HMI-bound command structure (jog, home, setpoint, mode bits).
  • DB_HMI_Status – the HMI-bound status structure (position, velocity, status word, error word, in-position flag).

Selection Mechanism

  1. HMI writes Selected_Axis (INT) to DB_HMI_DB.SelectedAxis.
  2. The PLC's multiplexer FB (FB_AxisMux, instance DB_AxisMux) is called in a cyclic OB, e.g., OB1 or OB35.
  3. The FB computes Index := Selected_Axis - 1, performs an out-of-range check, and uses MOVE_BLK to copy between DB_Axis[Index] and DB_HMI_Cmd / DB_HMI_Status.

SCL Block for Index-Based BLKMOV (S7-1500 style)


FUNCTION_BLOCK "FB_AxisMux"
VAR
    i : Int;
END_VAR
BEGIN
    // bounds check
    IF "DB_HMI_DB".SelectedAxis < 1 OR
       "DB_HMI_DB".SelectedAxis > 100 THEN
        "DB_HMI_DB".MuxError := TRUE;
        RETURN;
    END_IF;
    "DB_HMI_DB".MuxError := FALSE;

    i := "DB_HMI_DB".SelectedAxis;

    // copy status: axis -> HMI status structure
    MOVE_BLK(
        SRCBLK := "DB_Axis".Axis[i],
        RET_VAL := "DB_Mux".retVal,
        DSTBLK := "DB_HMI_Status".Axis,
        COUNT  := SIZEOF("DB_HMI_Status".Axis) / 2
    );

    // copy command: HMI command structure -> axis
    MOVE_BLK(
        SRCBLK := "DB_HMI_Cmd".Axis,
        RET_VAL := "DB_Mux".retVal2,
        DSTBLK := "DB_Axis".Axis[i],
        COUNT  := SIZEOF("DB_HMI_Cmd".Axis) / 2
    );
END_FUNCTION_BLOCK
Note on S7-1200: MOVE_BLK requires the optimized-block access attribute and the SCL compiler shipped with STEP 7 Basic V14+. On S7-300/400, use the classic BLKMOV block (FC20 / SFC20) or the BLKMOV_S variant for synchronous execution.

When (and When Not) to Use VBS in WinCC Comfort/Advanced

The original proposal—writing a VBS script that runs at screen-change and reassigns tag connections by name—is technically possible but is the wrong tool for the job in WinCC Comfort/Advanced for three reasons:

  1. VBS in Comfort/Advanced is a runtime macro language, not an engineering configuration language. It cannot change the tag-table wiring of a screen at compile time. Tag connections are fixed at compile time; VBS can only read/write values, change properties at runtime, or trigger actions. "Renaming the connection so the screen now shows Axis_B" is not a VBS-supported operation.
  2. VBS runs cyclically or on events but cannot move screen content. The script could update a property such as a text field's content, but it cannot reassign an I/O field's tag from Axis_A_ActualPosition to Axis_B_ActualPosition—that requires the HMI tag editor, not a script.
  3. VBS is for calculation and one-shot logic. Siemens documentation explicitly limits Comfort/Advanced VBS to non-cyclic actions: math, logging, value formatting, and event-driven reactions. Multiplexing is a configuration concern, not a runtime script concern.

Where VBS is useful for this project:

  • Compute a derived display value (e.g., efficiency = actual / setpoint × 100).
  • Format the SetpointPosition field with engineering units when toggling between mm and inches.
  • Validate that Selected_Axis is in range (1–3) and pop a transient message if not.
  • Log axis-fault transitions to a CSV on a USB stick.

If you need conditional tag binding, use tag multiplexing instead. If you need one screen to display all axes simultaneously, use UDT faceplates. Reserve VBS for non-cyclic calculations and event reactions.

Verification and Commissioning Checklist

Table 4 - Verification matrix
Step Action Pass criterion
1 Compile the HMI project Zero errors, zero warnings about tag resolution
2 Simulate with PLCSIM and the HMI runtime Each faceplate instance updates independently
3 Toggle the multiplex index from 1 → 2 → 3 in the HMI All screen I/O fields swap to the new axis without exception
4 Force a write to Axis_B.ActualPosition while the index points to Axis_A Screen does NOT update until the index switches to 2
5 Step the SCL FB_AxisMux in OB1 with breakpoints MOVE_BLK RET_VAL = 0; selected index latched correctly
6 Trigger an out-of-range selection (e.g., index = 99) MuxError flag asserts; HMI shows alarm
7 Power-cycle the panel; verify faceplate re-instantiates UDT tag instances retain values from PLC
8 Open HMI trace; confirm acquisition cycle < 500 ms for all 40 multiplexed tags Acquisition is faster than operator perception
9 Run a 24-hour soak with fault injection on each axis No stale values, no missed commands
10 Verify VBS scripts via Tools → Scripts → Check Syntax Zero errors; runtime trace shows expected calls

Troubleshooting Matrix

Table 5 - Common failures and corrective actions
Symptom Likely cause Corrective action
Multiplexed tag shows 0 or last value forever Index tag is local; PLC does not write to it Change the index tag's connection to the PLC; reload project
Faceplate instances all show Axis_A Tag instance property not set per instance Open faceplate instance properties and re-bind to Axis_B / Axis_C
Compilation error: "Tag does not exist" HMI UDT member name diverges from PLC UDT Match names character-for-character; data types must also match
BLKMOV returns ENO = 0 (S7-300/400) Source/destination overlap or invalid pointer Verify COUNT ≤ area size; check array bounds
VBS script does not reassign tag connection Tag connections are compile-time artifacts in Comfort/Advanced Replace script with tag multiplexing or faceplate
Stale axis value after index change Update event not configured on multiplex tag Set Update event to "On tag change" or "Cyclic continuous 500 ms"
Performance drop with 50+ axes HMI-side multiplexing scan exceeds cycle Move multiplexing to PLC via BLKMOV
Move_Forwards button toggles multiple axes Multiplex index accidentally broadcast to all instances Verify faceplate tag instance property is unique per drop
PLC STOP on STOP → RUN transition after FB added Uninitialized pointer in SCL FB Initialize pAxis; ensure target DB is non-optimized or set "Accessible from HMI"

Decision Workflow: Picking the Right Approach

Use this flowchart to choose between the three architectures for a new axis-screen requirement.

TIA Portal V13 SP1 or later? No Yes ≤10 axes? Use Tag Multiplexing Need simultaneous view? No Yes UDT + Faceplate (Recommended) PLC-side BLKMOV Default: UDT + Faceplate

Field-Proven Pitfalls

After reviewing the engineering trade-offs above, several pitfalls surface repeatedly across WinCC Comfort/Advanced projects. Document them in the project quality plan.

  1. Multiplex prefix mismatch. The index changes but the screen shows nothing because the prefix string was entered with an underscore in one DB and a hyphen in another. Tooling does not warn.
  2. UDT drift between PLC and HMI. After a project edit on the PLC, the HMI UDT must be re-synced. TIA Portal will prompt; ignore the prompt and the faceplate shows wrong types.
  3. License overshoot. Multiplexed tags still consume a configured HMI tag license. For 100 axes × 40 tags = 4,000 multiplexed tag entries. Confirm license headroom.
  4. VBS debugging blind spot. Comfort/Advanced VBS does not support breakpoints. If logic fails, the only diagnostic is the HMIRuntime.Trace call. Plan tracing before commissioning.
  5. FB_AxisMux cycle budget. BLKMOV of 40 Real values at OB35 100 ms is negligible, but at 200 axes × 40 values × 100 ms it may starve other OBs. Profile with the S7-1500 CPU web server or TRACE.

FAQ

Can I rename a tag connection at runtime with a VBS script in WinCC Comfort/Advanced?

No. Tag connections are compile-time artifacts in Comfort/Advanced. VBS can change properties and values but cannot reassign which tag an I/O field points to. Use tag multiplexing or a faceplate instance for variable selection.

How many axes can a single WinCC Comfort screen show simultaneously?

With tag multiplexing, one axis at a time (the selected index). With UDT faceplates, as many as the faceplate library allows—typically 50–100 instance drops on a Comfort panel, 200+ on an Advanced runtime.

Does tag multiplexing reduce my HMI tag license consumption?

No. Each multiplexed tag still occupies one entry in the tag table. Multiplexing reduces screen and configuration duplication, not the license count.

Which Siemens manual documents faceplates and UDTs?

Siemens Support entry 68014632 covers faceplates with HMI UDTs and PLC UDTs. The WinCC Comfort/Advanced programming manual (entry 109751716) covers multiplexing and the multiplex tag property.

Should the PLC or the HMI do the multiplexing for 100+ axes?

The PLC. BLKMOV/MOVE_BLK on the PLC is deterministic and frees the HMI cycle. The HMI then binds to a single command/status structure; the operator selects the axis index.

Back to blog