Siemens PCS7 Structure Tags: Configure and Link Process Tags

David Krause14 min read
SCADA ConfigurationSiemensTutorial / 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

Siemens PCS 7 structure tags provide a reusable template mechanism that lets a single WinCC picture serve dozens, or hundreds, of identical process objects — valves, motors, analog loops, conveyors — without duplicating graphics or hand-mapping thousands of individual tags. The structure tag template defines the variable set once; instances of that template, each with its own tag prefix and S7 address mapping, supply the runtime data.

This reference covers WinCC structure tag creation, AS-side UDT alignment, prefix assignment, Picture Window binding, and field-tested verification. Versions covered: PCS 7 V8.2 SP1, V9.0 SP2, and V9.1. TIA Portal–based PCS 7 / WinCC Professional configurations follow the same pattern but expose it through the HMI tag editor rather than the classic WinCC Explorer; the conceptual model is identical.

What Is a Structure Tag

A structure tag is a user-defined data type inside WinCC Explorer that mirrors the layout of an S7 UDT (User-Defined Type) or instance DB. It contains a fixed set of member variables — for example, RunFB, Fault, CmdStart, SpeedSP, and LocalRemote. Each member is bound to a specific S7 address when an instance of the structure tag is created.

Two pieces work together:

  • Structure tag definition (template) — created once in WinCC Tag Management. Defines names, data types, and lengths.
  • Structure tag instance — created once per AS connection or per logical group. Differs by tag prefix and by the S7 addresses bound to its members. Each instance appears in the runtime tag list as a set of fully qualified tags.

The advantage becomes clear on a plant with 240 identical pumps: one structure tag definition plus 240 instances replaces 240 × N individual tag definitions, where N is the number of faceplate fields.

When to Use Structure Tags

  • Repeating equipment with identical faceplate layouts (motors, valves, dosing pumps, fans, conveyors).
  • Picture Window-based popups that must show different live data per call.
  • SFC chart visibility or operator authorization per equipment number.
  • Bulk configuration across multiple AS stations (one prefix per AS).

Do not use structure tags when equipment types differ significantly, when only a handful of objects exist, or when addresses must be set programmatically (use dynamic dialogs or scripts instead).

Prerequisites

  • PCS 7 V8.2 SP1 or later (V9.0 / V9.1 supported).
  • WinCC Explorer (or TIA Portal HMI engineering for newer projects) with the PCS 7 component view licensed and active.
  • STEP 7 / SIMATIC Manager configured for the AS project (or TIA Portal with the AS source compiled and downloaded).
  • S7 program compiled with the UDT that mirrors the intended structure tag.
  • AS-OS engineering connection established — the AS must appear in the component view before WinCC can generate tags.
  • OS Runtime license sized to the resulting PowerTag count (one license consumed per structure tag instance member).

Architectural Overview

The runtime data path is straightforward:

  1. The AS runs the S7 program. The CFC chart uses the UDT as the instance DB for each physical asset.
  2. The engineering station compiles the OS — symbol information from STEP 7 / TIA flows to WinCC.
  3. WinCC Tag Management holds the structure tag template and the instantiated tags.
  4. The WinCC picture references tags in the form <prefix><member>.
  5. The Picture Window property Tag Prefix is set per call, swapping the prefix at runtime.

The Picture Window is the bridge: one picture file, many runtime personalities, no script duplication.

Step-by-Step Configuration

Step 1 — Define the S7 UDT and the Instance DBs

Open the S7 program in SIMATIC Manager (or the AS project in TIA Portal). Create a UDT that contains every field the faceplate must read or write. Example for a motor UDT, UDT_Motor:

<>Operator stop command
Member S7 Type Byte Offset Purpose
RunFB BOOL 0.0 Running feedback
Fault BOOL 0.1 Faulted status
CmdStart BOOL 0.2 Operator start command
CmdStop BOOL 0.3
Permit BOOL 0.4 Permissive (interlock result)
LocalRemote BOOL 0.5 Local / Remote selector
SpeedPV REAL 4.0 Speed process value (RPM)
SpeedSP REAL 8.0 Speed setpoint (RPM)
RuntimeHrs DINT 12.0 Accumulated runtime
EquipTag STRING[16] 16.0 Equipment identifier (e.g., "M-1201A")

Place the CFC chart for the motor block and assign the instance DB number (e.g., DB1001 for motor 1, DB1002 for motor 2). Each subsequent motor gets the next free DB inside the chart's numbering range. Compile the S7 program before generating the OS symbols.

Step 2 — Run "Compile OS"

In the component view, right-click the OS and choose Compile OS. This step exports the symbol table — including the UDT layout and instance DBs — so WinCC can resolve tag references. Wait for the compile to finish; any error here will surface later as unresolved addresses.

Step 3 — Create the Structure Tag in WinCC

Open WinCC Explorer. Expand the OS project and right-click Tag Management. Select Structure Tags from the context menu and add a new structure tag, name it MotorStruct.

Inside MotorStruct, add member tags that match the UDT field-for-field. The length and data type must match the S7 type exactly — otherwise runtime values will be misinterpreted or the channel will refuse to update.

Member Name Data Type (WinCC) Length Address Type
RunFB Binary Tag 1 bit DBx.DBXy.0
Fault Binary Tag 1 bit DBx.DBXy.1
CmdStart Binary Tag 1 bit DBx.DBXy.2
CmdStop Binary Tag 1 bit DBx.DBXy.3
Permit Binary Tag 1 bit DBx.DBXy.4
LocalRemote Binary Tag 1 bit DBx.DBXy.5
SpeedPV 32-bit IEEE 754 Float 4 bytes DBx.DBDy
SpeedSP 32-bit IEEE 754 Float 4 bytes DBx.DBDy+4
RuntimeHrs Signed 32-bit 4 bytes DBx.DBDy+8
EquipTag Text Tag, 8-bit 16 chars DBx.DBB[y+12], length 16

Step 4 — Add the AS Connection and Create Structure Tag Instances

Inside Tag Management, expand the S7 Protocol Suite channel. The connection that points to your AS appears under MPI, Industrial Ethernet, TCP/IP, or Named Connections depending on the bus type. Right-click the connection node and select New Tag → Structure Tag Instance.

Choose MotorStruct as the structure type and assign a tag prefix. The prefix is concatenated with each member name to form the runtime tag. Example:

Prefix: @Motor1_
MotorStruct + @Motor1_  ->  @Motor1_RunFB, @Motor1_Fault, @Motor1_SpeedPV, ...

Repeat the step for additional instances. Each instance must have a unique prefix. Instances may live on the same AS connection (different DB numbers) or on different AS connections (different physical controllers).

Instance Name Prefix AS Connection Sample Runtime Tag Bound DB
MotorStruct_1 @Motor1_ AS01 / MPI @Motor1_RunFB DB1001
MotorStruct_2 @Motor2_ AS01 / MPI @Motor2_RunFB DB1002
MotorStruct_3 @Motor3_ AS02 / IE @Motor3_RunFB DB2001

Step 5 — Bind Each Member to Its S7 Address

Open the first instance. For every member, set the address field using standard S7 syntax:

DB1001.DBX0.0   ; RunFB
DB1001.DBX0.1   ; Fault
DB1001.DBD4     ; SpeedPV
DB1001.DBD8     ; SpeedSP
DB1001.DBD12    ; RuntimeHrs
DB1001.DBB16,16 ; EquipTag (text, 16 chars)

Once the first instance is fully bound, copy it. Right-click the instance, Duplicate, and rename the duplicate (e.g., MotorStruct_2). Use the WinCC bulk-find-and-replace tool (Tools → Replace Across Project) to substitute the DB number — for instance, replace DB1001 with DB1002 across all member addresses of the second instance.

Verify the offset arithmetic manually. Floating-point and DINT members occupy 4 bytes; a Boolean member occupies 1 bit inside a byte. Re-verify after every bulk replace, especially across variable lists spanning multiple DBs.

Step 6 — Build the Faceplate Picture

Create a new PDL file, e.g., MotorPopup.pdl. Add the faceplate objects: an IO field for SpeedSP, a bar graph for SpeedPV, status displays for RunFB and Fault, pushbuttons for CmdStart and CmdStop, a text field for EquipTag.

For each object's variable property, reference the structure tag member using the prefix placeholder only:

  • IO field "SpeedSP" variable: @MotorPrefix_SpeedSP
  • Status display "RunFB" variable: @MotorPrefix_RunFB
  • Pushbutton "CmdStart" variable: @MotorPrefix_CmdStart

The placeholder text is literal — the Picture Window's Tag Prefix property replaces it at runtime. Do not hard-code a real prefix in the picture itself.

Step 7 — Bind the Picture Window Prefix Property

Open the calling picture (e.g., the motor overview). Place a Picture Window object. Set:

  • Picture Name: MotorPopup.pdl
  • Tag Prefix: dynamic, supplied at runtime (set to empty by default)

Place a button on each motor symbol and configure its Mouse → Click C action:

SetPropChar(lpszPictureName, "MotorWindow", "TagPrefix", "@Motor1_");
SetPropWord(lpszPictureName, "MotorWindow", "Visible", TRUE);

Replace "@Motor1_" with the appropriate prefix for each button. The same script block is reused for every motor — only the prefix string changes per instance.

Step 8 — Compile and Activate the OS

Save the WinCC project, then compile (Start → Programs → Siemens Automation → WinCC → Tools → Project Duplicator or just use Build OS). Activate Runtime. Open the motor overview and click each motor symbol — the popup should display the live values from the matching AS instance.

Tag Prefix Rules and Naming Limits

  • Maximum prefix length: 24 characters on PCS 7 V9.x (16 on older V8.x builds); keep prefixes short for readability.
  • Allowed characters: alphanumeric and underscore; the prefix must not start with a digit.
  • The fully qualified tag name (<prefix><member>) must remain within the 128-character WinCC tag-name limit.
  • Prefix matching is case-sensitive in V9.x; keep casing consistent between the calling script, the Picture Window property, and the instance definition.
  • Do not reuse a prefix on the same OS — runtime data will collide.
  • Avoid reserved characters in the prefix: ., :, -, and \ are not allowed.

Picture Window Configuration Details

Property Behavior
Tag Prefix String substituted into all <prefix>... references inside the picture at runtime
Picture Name PDL ( .pdl ) file opened when the Picture Window becomes visible
Display Show/Hide toggle; hiding does not unload the picture — prefix is preserved
Position X/Y coordinates; set to "centered on parent" for popup use
Sizable TRUE for resizable faceplates; FALSE for fixed-size popups

If a referenced variable is not found at runtime, WinCC logs Event ID 0x80010105 ("Tag not found / connection interrupted") in the diagnostics window. Look for this in the WinCC Alarm Logging system log under System Information.

Performance and Licensing Notes

Each structure tag instance member consumes one PowerTag license unit. A motor with 20 members on 200 motors equals 4,000 PowerTags. PCS 7 PowerTags ship in increments of 64, 256, 1024, 4096, and 8192. Audit every UDT member against the faceplate — drop fields that the operator never sees to keep the license count down.

S7 channel polling load: a typical AS connection on Industrial Ethernet handles 2,000–4,000 tags comfortably without measurable scan-time impact on the CPU. Above that, partition the tags across additional AS connections or upgrade the AS CPU to an AS 410 with a higher communication resource budget.

Migrating From V8 to V9

Structure tags survive PCS 7 V8 → V9 upgrades without conversion if the UDT was not modified. When migrating:

  1. Back up the WinCC project before the upgrade.
  2. Open the V9 component view and re-run Compile OS against the V9 AS project.
  3. Re-import the structure tag definitions; tag instances survive if the prefix is unchanged.
  4. Re-verify each Picture Window binding — V9 changed case-sensitivity rules, so any case-mismatched prefixes will now log unresolved-tag errors.
  5. Run WinCC Channel Diagnosis after the first Runtime start to confirm all AS connections are healthy.

Multi-OS Redundancy Considerations

On a redundant OS server pair, both servers must carry identical structure tag definitions and instances. Tag Management Project Duplicator handles this during standard project replication, but after any prefix change verify both servers independently:

  • Use Tag Export on the master OS, transfer the resulting .STL file to the standby, and Tag Import on the standby.
  • On the standby, run the same WinCC Channel Diagnosis tool and confirm every AS connection is in the Connected state.
  • Failover test: force the master offline and confirm the standby takes over without losing the prefix-bound picture state.

Verification Checklist

  • In WinCC Explorer, right-click each structure tag instance and choose Check Tag — all members must report green status.
  • Run the OS in simulation mode (Runtime on the engineering station, AS simulated with PLCSIM or SIMIT). Open the popup for each motor and confirm SpeedPV updates when the simulated value changes.
  • Toggle structure tag instance members and watch WinCC tag diagnostics for unresolved references.
  • Use WinCC Channel Diagnosis (Start → Programs → Siemens Automation → WinCC → Tools → Channel Diagnosis) to confirm every AS connection is in the Connected state.
  • Generate a tag export (Tools → Tag Export) and confirm the prefix-based names match the expected <prefix><member> pattern.
  • Export the structure tag instance to .STL and re-import on a second OS to confirm portability.
  • Force a failover on the redundant OS pair and confirm prefix substitution continues to work after switchover.

Troubleshooting Matrix

Symptom Probable Cause Corrective Action
All popup fields show #### after opening Tag prefix on Picture Window not set or wrong string Match prefix property byte-for-byte with the calling script argument
Tag is green in Tag Management but Picture Window field stays 0 Structure tag instance not bound to a DB address Open the instance, re-enter the address, recompile OS, restart Runtime
Tag not found error (Event 0x80010105) Member name typo or prefix not concatenated correctly Use tag search in WinCC Explorer to confirm the full tag name exists
One popup works, second popup shows another motor's data Two Picture Windows share the same prefix Assign a unique prefix per Picture Window instance
Changes to the structure tag do not propagate to running OS OS Runtime did not reload Stop the OS project, close WinCC, restart Runtime; verify Load Online Changes is enabled
Compile OS reports "Structure tag inconsistent" UDT in S7 modified after the WinCC structure tag was created Update the structure tag members to match the UDT, re-bind instances
Slow popup open on a large plant (>2000 motors) All Picture Windows loaded at project start Use SetPicture on demand and Hide instead of OpenPicture for infrequently viewed screens
Time-out error 0x80B0 reading tags after AS restart S7 connection lost Verify AS is healthy, then click Reconnect in Channel Diagnosis
Prefix changes do not take effect Picture Window was created without a configured Tag Prefix property Open the Picture Window properties and explicitly set the Tag Prefix string
Wrong motor shown after V8 → V9 upgrade Case-sensitivity rule change in V9 Audit every prefix for consistent casing across the calling script and the Picture Window property
Operator authorization not applied per motor Authorization checked on global tag, not on instance member Add an AuthLevel member to the UDT and reference it from the picture's authorization check

Best Practices

  • Use a single naming convention for prefixes across the project, e.g., @<EquipmentClass><Number>_.
  • Keep the UDT flat — avoid nested structures inside the UDT; the WinCC structure tag flattens anyway, and nested UDTs complicate address offset arithmetic.
  • Reserve the first member of every structure tag for the equipment identifier (e.g., EquipTag STRING[16]) — it simplifies alarm messaging and operator displays.
  • Add an AuthLevel member if per-motor operator authorization is required (e.g., valve actuators in hazardous zones).
  • Document prefix-to-DB mapping in an Excel sheet referenced from the project. The mapping is the single most error-prone configuration and is rarely captured in any export.
  • Build a test instance using a fixed simulation DB so commissioning engineers can exercise the popup without affecting the running plant.
  • Avoid embedding the prefix in scripts directly; route prefix strings through a central configuration file or a tag-prefix lookup tag for easier mass updates.

FAQ

How is a structure tag different from a normal WinCC tag?

A structure tag is a template containing multiple member variables. One definition produces many runtime tags when instantiated under different AS connections, drastically reducing configuration time for plants with repeating equipment such as motors and valves.

Can a structure tag instance point to multiple AS stations?

Each instance is bound to one AS connection. To read from multiple AS, create one instance per AS connection, each with its own unique tag prefix. The Picture Window then selects which prefix to apply per call.

What is the maximum number of structure tag instances?

WinCC itself allows several thousand instances. The practical limit is set by the PowerTag license and by the S7 channel's polling load — typically 2,000–4,000 tags per channel before performance degrades on a standard AS CPU.

Why does the popup show the wrong motor after I changed the prefix?

Picture Window tag-prefix substitution is case-sensitive in PCS 7 V9.x. Verify that the prefix string in the calling script exactly matches the prefix property of the Picture Window and the prefix used when the instance was created in Tag Management.

Does changing the S7 UDT force me to rebuild the structure tag?

Yes. Update the structure tag members to match the new UDT layout, re-bind the addresses on every instance, recompile the OS, and restart Runtime. WinCC does not auto-detect UDT changes; expect to re-export and re-import tags on redundant servers as well.

How do I move a configured structure tag project to a new OS server?

Use WinCC Explorer Project Duplicator to replicate the full project, or export the structure tag definitions and instances to a .STL file and import them on the target server. Verify the tag prefix and DB bindings after import — Duplicator preserves them, but manual .STL round-trips can lose prefix casing on V9.x.

Back to blog