Siemens Unified HMI: Word Tag Bit Dynamization Troubleshooting
Engineers migrating a TIA Portal project from a Comfort Panel (WinCC RT Advanced) to a Unified Comfort Panel (WinCC Unified runtime) frequently encounter a silent failure: a Word tag configured with a trigger bit continues to raise discrete alarms correctly, but the same tag no longer changes the color, visibility, or other property of a screen object. The trigger fires, the alarm logs, the PLC value is correct, yet the bound property never updates. This article documents the architectural cause, three field-proven remedies, and a migration checklist that prevents the issue at the project-planning stage.
Problem Summary
A trigger bit inside a 16-bit Word tag is observed for two distinct purposes in WinCC engineering:
- Alarm triggering - each bit position can be assigned to a separate alarm row with its own message text and class.
- Property dynamization - the value of a tag drives a state list (color, visibility, fill level, position, flashing).
On a Comfort Panel, both subsystems can interpret the trigger bit. On a Unified Panel, only the alarm subsystem does. The dynamization subsystem evaluates the entire Word as an integer and looks for that integer in a configured value list. Bits set inside the Word are not decomposed into individual states.
| Behavior | Comfort Panel (RT Advanced) | Unified Panel (WinCC Unified) |
|---|---|---|
| Trigger bit 0 raises a discrete alarm | Works | Works |
| Trigger bit 0 changes object color | Works (bit-level evaluation) | Fails (integer evaluation only) |
| Trigger bit 7 (value 128) raises a discrete alarm | Works | Works |
| Trigger bit 7 (value 128) changes object color | Works | Fails |
| Two bits set at the same time (value 3, 5, 6, 7) change color | Works (last-written bit wins) | Fails (value not in state list) |
Architecture: Trigger Bits in Comfort vs Unified
A trigger bit is a notification mechanism. It tells the HMI runtime that the value of the tag has changed and that the property bound to the tag should be re-evaluated. In the WinCC RT Advanced dynamization dialog, the engineer was offered a per-bit state table: pick bit 0, assign color green, pick bit 1, assign color yellow, and so on through bit 15. The runtime then read the Word, masked off each bit position, and applied the configured state.
WinCC Unified redesigns the dynamization property. The dialog exposes a value list - the engineer types the integer values that the property should react to (1, 2, 3, 4, 5, ...) and assigns a state to each. The runtime reads the Word and looks for the integer in that list. If the value matches, the corresponding state is applied. If the value does not match, the property falls through to the default state, which is typically the configured initial value of the property.
The trigger bit mechanism is unchanged. It is still the way the HMI decides when to poll the PLC for a refresh. What has changed is what the runtime does with the value after the refresh.
Root Cause: Why Dynamization Evaluates Integer Value, Not Bit Position
The trigger bit and the state selector are two independent concepts in the Unified runtime. Concretely, for a Word value of 0x0005 (binary 0000 0000 0000 0101, bits 0 and 2 set):
| Aspect | Comfort runtime | Unified runtime |
|---|---|---|
| Trigger evaluation | Bit 0 changed - poll PLC | Bit 0 changed - poll PLC |
| Alarm evaluation | Bit 0 fires alarm row 0; bit 2 fires alarm row 2 | Same - works correctly |
| Dynamization evaluation | Bit 0 - apply color from bit 0 row; bit 2 - apply color from bit 2 row | Look up value 5 in the configured state list. If 5 is not in the list, no state change. |
If the engineer had originally configured state values 1, 2, 4, 8 (one for each bit), the integer 5 is not in that list, and the property stays at its previous state. If the engineer reconfigures the state list to 1, 2, 3, 4, 5, 6, 7, 8 (all combinations), the property will react but cannot distinguish "bit 0 and bit 2 set" from "value 5 written directly." For mutually exclusive bits this is acceptable. For overlapping bits it is not, because two simultaneous states collapse into one integer value.
This behavior is documented in the WinCC Unified manual as a value-based dynamization model. The Comfort Panel's bit-level shortcut was a runtime convenience that has not been re-implemented in the Unified object model.
Step-by-Step Diagnosis
- Open the affected screen in the TIA Portal HMI editor.
- Select the screen object whose property is not updating. In the Properties window, expand the relevant property (for example, Appearance > Background color or Visibility).
- Confirm the property is bound to a tag of data type Word, Int, or UInt. Confirm the trigger configuration is set to Trigger bit with a selected bit number.
- Open the HMI tag editor. Force the value of the tag to 1, then 2, then 4, then 8 using the HMI tag simulation table or the PLCSIM Advanced software.
- Observe whether the property updates. If only the values 1, 2, 4, 8 produce a state change and 3, 5, 6, 7 do not, the runtime is in integer-evaluation mode. The trigger bit is recognized; it is the state selector that is missing.
- Force the value to 0 (all bits cleared). The property should fall back to the default state or the initial property value.
- Switch to the runtime diagnostic viewer (Control Panel > System > Diagnostics) and confirm the tag is being acquired. If the tag is not in the acquired-tags list, the connection is broken; fix that first before re-testing the dynamization.
Solution A: Value-Based Dynamization with Mutually Exclusive Bits
If the PLC writes only single-bit values (never two bits at the same time), the Unified value-based dynamization is the cleanest approach. Configure a state list with the values 1, 2, 4, 8, 16, 32, 64, 128 and assign the required appearance to each state. The PLC enforces mutual exclusion.
// TIA Portal - Value list configuration
Tag: HMI_Tag_Color (Word)
Trigger bit: 0
States:
Value 1 -> Color: Green (status OK)
Value 2 -> Color: Yellow (status warning)
Value 4 -> Color: Red (status fault)
Value 8 -> Color: Blue (status manual)
Value 16 -> Color: Gray (status offline)
Value 32 -> Color: Orange (status maintenance)
Value 64 -> Color: Purple (status calibration)
Value 128 -> Color: Cyan (status test)
Add an interlock in the PLC so that writing a new state automatically clears the previous one. The example below uses SCL on an S7-1500 / S7-1200 controller:
// SCL - Mutually exclusive single-bit writes (S7-1500)
IF "i_WriteNewState" > 0 AND "i_WriteNewState" <= 8 THEN
"DB_Status".HMI_ColorBits := 0; // clear all bits
"DB_Status".HMI_ColorBits.%X0 := "i_WriteNewState" = 1;
"DB_Status".HMI_ColorBits.%X1 := "i_WriteNewState" = 2;
"DB_Status".HMI_ColorBits.%X2 := "i_WriteNewState" = 4;
"DB_Status".HMI_ColorBits.%X3 := "i_WriteNewState" = 8;
END_IF;
This is the lowest-overhead solution: no scripts, no extra tags, and the property is updated by the runtime's native value-list evaluation. Recommended when the application owns the PLC code and the flags are guaranteed to be mutually exclusive.
Solution B: VBScript Bit-Mask Evaluation
When two or more bits can be active simultaneously, the value-based approach collapses because the integer representation no longer maps to a single state. The next option is a VB script that performs a bitwise AND against the mask of each bit and returns a state value that the dynamization list can resolve.
In WinCC Unified, attach a script function to the property's dynamization column. The runtime evaluates the function on every trigger change of the source tag and uses the return value as the state index for the value list.
' WinCC Unified - VBScript function for bit-mask color dynamization
Function Color_Bits(ByVal item)
Dim wColor : wColor = item
Dim nState : nState = 0
If (wColor And 1) <> 0 Then nState = 1 ' bit 0 - status OK
If (wColor And 2) <> 0 Then nState = 2 ' bit 1 - status warning
If (wColor And 4) <> 0 Then nState = 3 ' bit 2 - status fault
If (wColor And 8) <> 0 Then nState = 4 ' bit 3 - status manual
If (wColor And 16) <> 0 Then nState = 5 ' bit 4 - status offline
If (wColor And 32) <> 0 Then nState = 6 ' bit 5 - status maintenance
If (wColor And 64) <> 0 Then nState = 7 ' bit 6 - status calibration
If (wColor And 128) <> 0 Then nState = 8 ' bit 7 - status test
Color_Bits = nState
End Function
Pair the script with a value list in the dynamization column:
// Value list for the script-driven state tag
Value 0 -> Default (no color change)
Value 1 -> Color: Green
Value 2 -> Color: Yellow
Value 3 -> Color: Red
Value 4 -> Color: Blue
Value 5 -> Color: Gray
Value 6 -> Color: Orange
Value 7 -> Color: Purple
Value 8 -> Color: Cyan
CLng(item) or convert the parameter to a Word type at the HMI tag declaration. The symptom is "the script returns 0 for values 256, 512, 1024 ..."Solution C: Restructure to One Int Tag per State Slot
The most portable and least error-prone approach is to remove the bit-packing entirely. Define one Int per state slot in the PLC data block, write the state index directly into each Int, and bind each Int to its own dynamization property. This is the pattern Siemens engineering recommends for screens with many status objects.
| Address | Symbol | Type | Purpose |
|---|---|---|---|
| DB_Status.DBW0 | StatusObject_01 | Int | State index 0-8 for object 1 |
| DB_Status.DBW2 | StatusObject_02 | Int | State index 0-8 for object 2 |
| DB_Status.DBW4 | StatusObject_03 | Int | State index 0-8 for object 3 |
| ... | ... | ... | ... |
| DB_Status.DBW176 | StatusObject_89 | Int | State index 0-8 for object 89 |
| DB_Status.DBW178 | StatusObject_90 | Int | State index 0-8 for object 90 |
Each Int tag is bound to a single color or visibility dynamization with a clean value list. The PLC becomes the single source of truth for the state index, and the HMI simply maps an integer to a state.
// SCL - State write helper for 90 Int slots
FUNCTION "fbWriteStatus" : Void
VAR_INPUT
i_ObjectIndex : Int; // 1..90
i_State : Int; // 0..8
END_VAR
VAR_TEMP
s_Path : String;
END_VAR
BEGIN
// Bounds check
IF i_ObjectIndex < 1 OR i_ObjectIndex > 90 THEN RETURN; END_IF;
IF i_State < 0 OR i_State > 8 THEN RETURN; END_IF;
CASE i_ObjectIndex OF
1: "DB_Status".StatusObject_01 := i_State;
2: "DB_Status".StatusObject_02 := i_State;
3: "DB_Status".StatusObject_03 := i_State;
...
90: "DB_Status".StatusObject_90 := i_State;
END_CASE;
END_FUNCTION
The tradeoff is PLC memory (180 bytes for 90 Int objects) and tag count in the HMI tag editor (90 tags instead of 1). On a Unified Comfort Panel with a recommended tag budget of several thousand tags, 90 tags is negligible. The runtime cost is zero script execution and zero bit-mask evaluation - the panel simply reads an Int and matches it to a state.
| Aspect | Solution A (value list) | Solution B (VBScript) | Solution C (Int tags) |
|---|---|---|---|
| PLC changes required | Mutual-exclusion logic | None | Replace Word with N Int |
| HMI tag count change | None | None | N tags added |
| Script execution | None | Required per property | None |
| Multi-bit states | Not supported | Supported (priority-based) | Not applicable |
| Diagnostic clarity | High - direct value mapping | Low - script debug required | Highest - one tag per state |
| Best for | Status registers with exclusive bits | Status registers with overlapping bits | High-density status dashboards |
Migration Checklist from Comfort to Unified
- Inventory all HMI tags that drive a Comfort Panel bit-level dynamization. In TIA Portal, use Project > Cross-references and filter for the dynamization property column. The output lists every tag bound to a property.
- For each tag, decide: is the bit pattern truly mutually exclusive in the PLC, or can two bits be set at once? Read the PLC code, do not assume. If mutually exclusive, keep the Word and apply Solution A. If not, apply Solution B or C.
- If the Comfort Panel used a 16-bit Word with 16 status flags, evaluate Solution C. The engineering cost is one data block edit plus 16 HMI tag bindings. The runtime cost is zero.
- Confirm that trigger bits are still configured where the tag is acquired on a non-default cycle. In Unified, the standard acquisition cycle is 1 s; trigger-bit acquisition can be sub-100 ms if the PLC scan allows. Without a trigger bit, the property may update only once per second.
- Verify that discrete alarms using the same Word tag still work after migration. The alarm subsystem evaluates trigger bits independently from the dynamization subsystem, so alarms typically continue to function without changes.
- Test edge cases: all bits cleared, all bits set, individual bits toggled at 100 ms intervals, two bits toggled simultaneously.
- Document the chosen solution for each affected tag in the project comments. Future maintenance engineers will need to know whether the value list is a state map, a script is decoding bits, or the PLC is sending raw state indices.
Performance and Limits on Unified Comfort Panels
| Panel | Display | Recommended tag count | VBScript evaluations per second |
|---|---|---|---|
| MTP700 Unified Comfort | 7" | 1,500 | 30 |
| MTP1000 Unified Comfort | 10" | 2,500 | 60 |
| MTP1200 Unified Comfort | 12" | 3,500 | 90 |
| MTP1500 Unified Comfort | 15" | 4,500 | 120 |
| MTP1900 Unified Comfort | 19" | 6,000 | 180 |
| MTP2200 Unified Comfort | 22" | 8,000 | 240 |
Beyond the recommended tag count, the runtime's tag manager starts to drop updates on the panel. Beyond the VBScript evaluations per second threshold, script execution falls behind the trigger cadence and the panel shows stale data. Solution C is preferred for screens with more than 200 status objects because it removes script overhead entirely.
The 90 x 4 case (90 status objects with 4 color states each) is well within the budget for every Unified Comfort Panel model. The solution that scales best is Solution C - 360 Int tags, no scripts, no bit-masking, predictable behavior. For an S7-1500 with a 1 ms OB1 cycle, writing 360 Int values per second is negligible.
Verification Steps
- Force a Word value of 1 in the HMI tag simulation table. Verify the bound property updates to the state assigned to value 1 (Solution A) or to the state returned by the script (Solution B).
- Force a Word value of 5 (binary 0101, bits 0 and 2 set). With Solution A and a value list of 1, 2, 4, 8, the property falls back to the default. With Solution B, the script returns the priority bit's state. With Solution C, the bit-packed word no longer exists and the test is moot.
- Toggle a bit at 100 ms intervals using a PLC flag pulse generator. Confirm the property updates within 200 ms on the panel.
- Run the panel through a power-cycle and verify that the initial state of each property matches the PLC's initial value at startup. A common migration error is leaving the property's initial value at the TIA Portal default instead of binding it to the PLC's startup value.
- Open the runtime diagnostic viewer and confirm no script errors are logged. If VBScript errors appear, the bit-mask function is being called before the tag has been acquired for the first time; add an initialization guard that returns the default state when the tag value is uninitialized.
- Inspect the HMI tag's update time in the diagnostics viewer. The "Last update" timestamp should be within the trigger cycle of any PLC value change. A timestamp that is older than 1 s indicates the trigger bit is not firing.
Troubleshooting Matrix
| Symptom | Likely cause | Fix |
|---|---|---|
| Discrete alarm fires, color does not change | Unified evaluates Word as integer in dynamization | Apply Solution A, B, or C |
| Color changes for value 1, 2, 4, 8 but not 3, 5, 6, 7 | Value-based dynamization with non-mutually-exclusive bits | Use Solution B (script) or Solution C (Int tags) |
| Property never updates, no alarm either | Tag acquisition issue, connection broken | Check PLC connection in runtime diagnostics |
| Property updates but with 1 s lag | Trigger bit not configured; tag on default 1 s cycle | Configure trigger bit on the source tag |
| VBScript error "Object required" at runtime | Tag name typo or tag not yet defined at compile time | Verify tag in TIA Portal tag editor, recompile |
| Color flickers between two states | PLC toggling bit faster than trigger cycle | Add hysteresis in PLC, increase trigger bit dwell |
| Script returns 0 for values 256, 512, 1024 | Signed-Int local variable interprets bits 8-15 as negative | Use Word type or cast to CLng in the script |
| Value list shows 1, 2, 3, 4, 5 but property only updates for 1, 4 | Engineer configured "Bit" evaluation by mistake; runtime uses integer | Reconfigure the dynamization as a value list, not a bit list |
| Property updates correctly on the engineering station but not on the panel | Project not fully compiled and downloaded; only the alarm subsystem was transferred | Recompile the HMI, perform a full download to the panel |
| PLC writes 3 to a Word, property flickers between two states | Two bits set simultaneously, integer falls into a value-list gap | Apply Solution C or enforce mutual exclusion in the PLC |
Common Pitfalls and How to Avoid Them
Assuming the bit-level Comfort behavior carries over. The most common mistake is to migrate the project and assume the dialogs behave the same. They do not. Audit every dynamization property that uses a Word tag before commissioning the Unified Panel.
Using Real or DInt tags for status flags. The Unified runtime evaluates Real values as floating-point numbers. A list of 1, 2, 4, 8 will not match 1.0, 2.0, 4.0, 8.0 on all firmware versions because of precision handling. Use Int or Word for status flags and reserve Real for analog values.
Neglecting the initial value of the dynamization property. A Word tag with a startup value of 0 will leave the property at its initial value until the PLC writes a non-zero value. If the PLC starts in a fault state, the property may show the wrong color for several seconds after power-on. Bind the initial value of the property to a known safe state or force a value-list entry of 0.
Forgetting the trigger bit on a Word whose low byte changes. A Comfort Panel often used bit 0 as a global "any change" trigger for the entire Word. The Unified runtime does not auto-promote bit 0 to a global trigger. Configure the trigger bit deliberately: bit 0 for change on the low byte, bit 8 for change on the high byte, or a single dedicated "update" bit in the PLC.
Confusing the acquisition cycle with the dynamization cycle. The acquisition cycle is how often the HMI polls the PLC. The dynamization cycle is how often the runtime re-evaluates the value list. On the Unified runtime these are independent. A 1 s acquisition with a 100 ms dynamization will still leave the property stale for up to 1 s after a PLC change.
Related Siemens Documentation
- WinCC Unified - Configuration Manual - official configuration reference for the Unified runtime, dynamization model, and value lists.
- TIA Portal V18 Unified Help - integrated help portal for the V18 engineering environment.
- WinCC Unified - VBScript Reference - scripting language reference for the Unified runtime.
- SIMATIC Unified Comfort Panels Operating Instructions - hardware limits, performance budgets, and panel-class specifications.
FAQ
Why does my trigger bit raise a discrete alarm on the Unified Panel but not change a screen object's color?
Discrete alarms in WinCC Unified are evaluated at the bit level because each bit of a Word is mapped to a separate alarm row. Color and visibility dynamization is evaluated at the integer value level - the runtime looks for the value in a configured state list. Configure the dynamization to match the integer value (1, 2, 4, 8 ...) or move the bit evaluation into a VBScript function.
How do I evaluate a single bit of a Word tag in a Unified HMI script?
Use a bitwise AND. In VBScript: If (SmartTags("MyTag") And 2) <> 0 Then ... End If. The mask 2 (binary 0010) tests bit 1. Use powers of two (1, 2, 4, 8, 16, 32, 64, 128, 256 ...) to test each successive bit. Return a state index that the dynamization value list can resolve.
What is the fastest way to migrate 90 Word tags with 4 bits each from a Comfort Panel to a Unified Panel?
Replace each Word with four Int tags in the PLC data block and bind each Int to its own screen object property. The migration effort is one data block edit plus 360 HMI tag bindings. Runtime overhead is zero and no scripts are required. The 360 Int tags are well within the tag budget of every Unified Comfort Panel model from MTP700 upward.
Can the Unified runtime be configured to evaluate bits directly in dynamization as the Comfort Panel did?
No. As of TIA Portal V19 Update 1, the dynamization dialog on Unified Comfort Panels exposes only value lists, not bit lists. The Comfort Panel's bit-level dynamization was a runtime shortcut that has not been re-implemented in the Unified object model. Use a VBScript function for bit evaluation or restructure the data in the PLC.
Does the trigger bit still work the same way in Unified as in Comfort?
Yes. The trigger bit defines when the HMI runtime polls the PLC for an update. It is independent of how the dynamization property interprets the value. Configuring a trigger bit on bit 3 of a Word still causes the runtime to poll whenever bit 3 changes; it just does not tell the dynamization to use bit 3 as the state selector.
My Word value is 5 (bits 0 and 2 set). Why does the property fall through to the default state?
The Unified value-based dynamization looks for the integer 5 in the configured state list. If the list contains only 1, 2, 4, 8 (the values for individual bits), 5 is not a member and the property stays at its default. The runtime does not decompose 5 into "bit 0 plus bit 2." To handle multi-bit states, use a VBScript function that maps each bit combination to a specific state index, or split the Word into multiple Int tags in the PLC.