Dynamically Populating Symbolic IO Field Lists in WinCC Flexible 2005 / TIA Portal Unified
On a Siemens TP 270 (6AV6 545-series compact HMI) engineered with WinCC Flexible 2005, a frequent requirement is to expose a variable number of selection items in a Symbolic IO Field based on the runtime value of another PLC tag. For instance, when a process tag reads 2, the operator should see 2 entries; when it reads 4, the operator should see 4 entries. The WinCC Flexible runtime object model does not allow a VBScript to re-write the text list of a Symbolic IO Field at runtime the way the native WinCC (PC-based) object model does, so engineers must apply one of three proven workarounds: (1) stacked IOFields with layer-based visibility toggling, (2) indirect-tag indexing against a pre-populated, oversized text list, or (3) full migration to WinCC Unified in TIA Portal, where the Symbolic IO Field now supports a dynamic data source.
TextList reference is fixed at compile time and is read-only at runtime. The native WinCC (TIA / PCS 7) HMI runtime model differs, but the WinCC Flexible 2005 CE runtime is intentionally trimmed to keep the WinCE image small. Plan workarounds accordingly.1. Problem Definition
The requirement pattern is well known in machine-builder HMIs: a recipe parameter or process state variable determines how many operator-selectable options should appear in a drop-down. The naive implementation asks the runtime to grow or shrink the Symbolic IO Field's selection list at runtime:
| Trigger Tag Value | Desired Number of Items | Example Application |
|---|---|---|
| 1 | 1 | Single-mode operation |
| 2 | 2 | Manual / Automatic |
| 3 | 3 | Manual / Semi-Auto / Auto |
| 4 | 4 | Setup / Manual / Semi-Auto / Auto |
| n | n | Number of machine states |
The challenge is that the Symbolic IO Field's selection list is statically bound to a Text List or Graphics List configured under Project > Language and Font > Text Lists in WinCC Flexible 2005. That binding cannot be replaced at runtime through the public VBScript property surface.
2. Symbolic IO Field Object Model in WinCC Flexible 2005
The Symbolic IO Field combines an input/output numeric field with a configurable drop-down of selectable list entries. The selection list is sourced from a Text List object whose List Range defines the integer-to-text mapping:
- Range type — Bit (0/1), Byte (0…255), Word (0…65535), Dword (0…4294967295), or Decimal (configurable start / end / step).
- List entries — Each value in the range maps to a default text and, optionally, a graphics file reference.
- Output mode — Output Value, Input/Output Value, or Input Only.
At compile time the Symbolic IO Field is bound to a specific Text List via the configuration dialog Properties > General > Selection List. The runtime receives the compiled list as a constant internal structure; no public property exposes the array of entries, and there is no AddItem, RemoveItem, or SetTextList method on the object.
SSMIOField.TextList with full read/write semantics. The WinCC Flexible 2005 CE runtime on TP 270/OP 270/MP 270/MP 370 does not implement that property; an attempt to write it raises runtime error "Object doesn't support this property or method" (VBScript error 0x800A01B6).3. VBScript Access Pattern for ScreenItems
You can still address the IO Field by name through the HmiRuntime.ActiveScreen.ScreenItems collection, and use the writable properties to control appearance. The canonical access pattern is:
' VBScript: read and manipulate a Symbolic IO Field
Dim objIOField
Set objIOField = HmiRuntime.ActiveScreen.ScreenItems("Symbolic_IOField_1")
' Read-only / read-write properties you CAN manipulate at runtime:
objIOField.Visible = True ' toggle visibility per layer strategy
objIOField.Enabled = False ' grey-out without hiding
objIOField.Left = 120 ' repositioning for dynamic layouts
objIOField.Top = 80
objIOField.Width = 200
objIOField.Height = 32
objIOField.Layer = 5 ' raise/lower in z-order
objIOField.TooltipText = "State selector"
' Numeric process values are still modifiable:
objIOField.OutputValue = 2
objIOField.ProcessValue = 2
The IntelliSense list in the WinCC Flexible Script Editor will stop there. There is no .TextList, .Items, .AddItem(), or .RemoveItem() on the WinCC Flexible object. The complete writable property set is documented in the WinCC Flexible online help under Working with WinCC flexible > Configuring Screens > Access to objects — open it from the Help menu (Help > WinCC flexible Information System or press F1 on a selected object).
4. Why the Text List Cannot Be Re-Mapped at Runtime
The text list is loaded into the CE runtime image as a compiled resource table. VBScript access on the panel is sandboxed to a controlled property set, and list-management APIs are excluded by design to keep the WinCE 5.0 footprint of the TP 270 under 32 MB of image RAM. The architectural constraints are:
- Static resource — Text lists are baked into the .fwx project file at compile time.
- Sandbox surface — The CE VBScript engine exposes only the documented property set; reflection-style discovery is not supported.
- No allocator — There is no underlying buffer that the script can re-size; the list lives in a fixed-size managed region.
Engineers sometimes attempt a workaround by writing the visible list entries to a string tag and using that tag as the input on a regular IO Field, but this loses the drop-down behavior. A better approach is to keep the drop-down but build a fixed list large enough to cover the worst case, and use scripting + visibility to present the correct subset.
5. Workaround 1 — Stacked IOFields with Visibility Toggle
The most reliable, fully-supported pattern on WinCC Flexible 2005 is to overlay multiple Symbolic IO Fields at the same screen coordinates, each with its own pre-compiled text list, and toggle visibility based on the trigger tag. The runtime only ever shows the IOField whose list length matches the requirement.
5.1 Configuration
- Open the screen that contains the Symbolic IO Field.
- From the toolbox (View > Toolbars > Objects), drag a Symbolic IO Field onto the canvas.
- In Properties > General > Selection List, bind the field to a dedicated text list — e.g.
TextList_StateList_2items. - Set Properties > Layout > Layer to a high value such as 20 so the field sits on top of normal graphics.
- Repeat steps 2–4 for each size variant you need, positioning them at identical X/Y coordinates and identical width/height.
- For each IOField, in Properties > Animation > Visibility, create an animation of type Tag bound to the trigger tag (e.g.
HMI_Tag_StateCount), with a value range of 2 … 2 for the 2-item variant, 3 … 3 for the 3-item variant, and so on. Outside the range, the visibility animation hides the field.
5.2 VBScript Alternative to Visibility Animation
If you prefer a single script entry point, drive the visibility from a VBScript function called on a value-change event of the trigger tag:
' VBScript: called from a "Change value" event on HMI_Tag_StateCount
Sub SelectStateIOField_ByCount(ByVal Item)
Dim sName, i
Dim arrFields(4)
arrFields(0) = "IOField_StateList_1"
arrFields(1) = "IOField_StateList_2"
arrFields(2) = "IOField_StateList_3"
arrFields(3) = "IOField_StateList_4"
arrFields(4) = "IOField_StateList_5"
Dim iCount
iCount = SmartTags("HMI_Tag_StateCount").Value
' Clamp into supported range
If iCount < 1 Then iCount = 1
If iCount > 5 Then iCount = 5
For i = 0 To UBound(arrFields)
If HmiRuntime.ActiveScreen.ScreenItems.Exists(arrFields(i)) Then
HmiRuntime.ActiveScreen.ScreenItems(arrFields(i)).Visible = CBool(i = (iCount - 1))
End If
Next
End Sub
Hook this sub to the Change Value event of the trigger tag through Project > Events > Tag > Change Value. The function iterates the pre-placed fields and shows only the one whose index matches iCount - 1.
6. Workaround 2 — Indirect Tag Indexing with Pre-Populated Text List
If the count is dynamic and not bounded by a small set, use a single Symbolic IO Field with a pre-populated text list covering the maximum expected items, and have the PLC decide which entries are valid. Pair this with a tag that masks the selection range:
- Create a Text List with entries 0 … 15, each carrying the appropriate state name.
- Bind the Symbolic IO Field to this list.
- Add a VBScript that reads the trigger tag and writes a clamped mask to the input value if the operator selects an entry beyond the active count:
' VBScript: validate operator selection against active count
Sub ValidateSelection(ByVal Item)
Dim iSel, iCount
iSel = SmartTags("HMI_Tag_StateSel").Value
iCount = SmartTags("HMI_Tag_StateCount").Value
If iSel > iCount Then
SmartTags("HMI_Tag_StateSel").Value = iCount
ShowSystemAlarm("Selection out of range. Clamped to " & iCount)
End If
End Sub
This approach scales to a 16, 32, or 64-entry text list, but operator UX suffers because all entries are always shown and only a post-selection alarm informs the operator. Use it only when the count varies beyond a small set.
7. Workaround 3 — Recipe / PLC-Driven Index Mapping
For complex machines where the selection list must be derived from a recipe (e.g. 6-axis tool changer, 30-tool magazine), the cleanest architecture is to keep the Symbolic IO Field on the panel purely as a numeric selector, and let the PLC build the text representation in a string tag that the screen displays alongside:
- Operator selects a numeric index on the Symbolic IO Field (range 0…29).
- PLC looks up the index against a recipe array and writes the resolved name to a string tag.
- The HMI shows a Text IO Field bound to that string tag next to the selector.
This decouples the list maintenance (recipe) from the HMI configuration, and is the standard pattern for large catalog-style selection menus on TP 270 / OP 270 panels.
8. Migration to WinCC Unified — Dynamic Data Source Items
If the project is being re-engineered, the WinCC Unified Symbolic IO Field in TIA Portal V20 / V21 does support runtime population of the selection list through a data source. The relevant Siemens documentation pages are:
- Symbolic IO field (RT Unified) — TIA Portal V20 documentation
- Symbolic IO field (RT Unified) — TIA Portal V21 documentation
In WinCC Unified, the Symbolic IO Field exposes a Data source property that can be configured as a List of values sourced from an HMI tag list. The runtime API in Unified supports:
// JavaScript on WinCC Unified Unified RT
let ioField = Screen.FindItem("SymbolicIOField_1");
let items = ioField.GetDataSource();
items.Add({ "Value": 1, "Text": "Manual" });
items.Add({ "Value": 2, "Text": "Semi-Auto"});
items.Add({ "Value": 3, "Text": "Auto" });
ioField.SetDataSource(items);
The exact API surface depends on the TIA Portal version. In TIA V20 the data source must be configured in engineering; in TIA V21 the Adding data source items (RT Unified) procedure allows runtime addition. Confirm the API contract for your target firmware before depending on dynamic add/remove.
| Capability | WinCC Flexible 2005 (TP 270) | WinCC Unified (TIA V20) | WinCC Unified (TIA V21) |
|---|---|---|---|
| Compile-time text list | Yes | Yes | Yes |
| Runtime list re-population (VBScript) | No | Limited (re-binding via API) | Yes (data source items API) |
| Layered visibility toggle | Yes | Yes | Yes |
| Indirect tag indexing | Yes | Yes | Yes |
| Script language | VBScript | JavaScript / VB | JavaScript / VB |
9. Step-by-Step Implementation: Visibility-Toggle Method
This procedure implements Workaround 1 on a TP 270 with WinCC Flexible 2005 for the canonical 1…5 item case.
9.1 Prerequisites
- WinCC Flexible 2005 SP3 or later (HF7 recommended for TP 270 image stability).
- TP 270 6" or 10" panel with firmware V08.01.07 or later (verify in Panel > Transfer > OS Update).
- PLC tag
DB100.DBW0of typeINTthat carries the active count (1…5). - HMI tag
HMI_Tag_StateCountconfigured as a 16-bit signed integer pointing toDB100.DBW0.
9.2 Configuration
- Open the target screen in the WinCC Flexible 2005 project editor.
- Open Project > Language and Font > Text Lists.
- Create five text lists, named exactly:
TL_States_1,TL_States_2,TL_States_3,TL_States_4,TL_States_5. Use a Decimal range starting at 0 with the appropriate number of entries per list. - Place five Symbolic IO Fields at identical coordinates (e.g.
X=120, Y=80, W=200, H=32), all on Layer 20. - Bind each field to its corresponding text list.
- For each field, configure Properties > Appearance > Visibility with a default value of Invisible.
- For each field, add a Tag-based animation on Visibility using
HMI_Tag_StateCountwith the corresponding range.
9.3 VBScript Wiring
Open Project > Events > Tag > HMI_Tag_StateCount > Change Value and add:
Sub OnChange_HMI_Tag_StateCount(ByVal Item)
Dim iCount
iCount = SmartTags("HMI_Tag_StateCount").Value
If iCount < 1 Then iCount = 1
If iCount > 5 Then iCount = 5
Dim sNames(4)
sNames(0) = "IOField_TL_States_1"
sNames(1) = "IOField_TL_States_2"
sNames(2) = "IOField_TL_States_3"
sNames(3) = "IOField_TL_States_4"
sNames(4) = "IOField_TL_States_5"
Dim i
For i = 0 To UBound(sNames)
If HmiRuntime.ActiveScreen.ScreenItems.Exists(sNames(i)) Then
HmiRuntime.ActiveScreen.ScreenItems(sNames(i)).Visible _
= CBool(i = (iCount - 1))
End If
Next
End Sub
Compile the project (Project > Compiler > All) and transfer to the TP 270.
10. Verification and Runtime Checks
After transfer, verify on the panel:
- Power-cycle the TP 270 and confirm the project boots into the configured start screen.
- Set the trigger tag to 1, 2, 3, 4, and 5 in the PLC (use the Watch table in STEP 7 or the online monitor). The screen should swap the visible IO Field in < 500 ms.
- Tap the visible field and confirm the drop-down shows exactly the expected number of entries.
- Set the trigger tag to 0 and 6 and confirm the script clamps to 1 and 5 respectively without throwing an exception.
- Open Panel > Information > System Diagnostics on the panel; no VBScript errors should be logged.
To check the WScript-level error log remotely, enable Project > Runtime Settings > Services > Sm@rtServer and connect via the Sm@rtClient app. Errors appear in the system event log with error class Script.
11. Troubleshooting Matrix
| Symptom | Likely Cause | Fix |
|---|---|---|
| Object doesn't support this property or method (0x800A01B6) | Attempting to write .TextList or .Items at runtime |
Switch to visibility-toggle or indirect-indexing workaround; do not attempt list mutation |
| All IOFields visible at once | Layering misconfigured; the visibility animation not evaluated | Set all variants to Layer 20; ensure the Tag-based animation is enabled on the Visibility property, not Appearance |
| Field not switching on tag change | Script attached to wrong event | Attach to Change Value on the trigger tag, not on the IOField process value |
| Alarm "Screen item not found" at runtime | Item name mismatch (underscore vs. space) | Use the exact name from Properties > General > Name; WinCC Flexible replaces spaces with underscores at compile time |
| Field flashes when count changes | Visibility animation re-evaluating on every tag change | Increase the Update cycle on the animation from 100 ms to 500 ms if process allows |
| Compiled project rejects transfer | Empty text list range | Ensure every text list has at least one defined entry; an empty list fails the project consistency check |
| Unified runtime cannot call SetDataSource | API gated to TIA V21 with specific build | Check TIA Portal version in Help > About; upgrade to V21.9 or later for full runtime data source item support |
12. Notes on the Symbolic IO Field and Migration Safety
When porting a legacy WinCC Flexible 2005 screen to TIA Portal Unified, the Symbolic IO Field migration wizard preserves the bound text list, but the runtime behavior of the List of values property has changed: in WinCC Flexible, the list is integral to the field; in Unified, the list is a property of the Tag that the field references. Re-test all visibility-toggle scripts after migration because the HMI tag access syntax differs:
- WinCC Flexible 2005:
SmartTags("HMI_Tag_StateCount").Value - WinCC Unified (JavaScript):
Tags("HMI_Tag_StateCount").Read()
The visibility-toggle strategy itself still works in Unified because Screen.FindItem(...).Visible is part of the Unified object model. Plan a phased migration: keep the visibility-toggle code working through WinCC Flexible 2008 (last CE release) and TIA V13/V14/V15 panels that still target TP 270, then re-architect to the data-source model on Unified Comfort Panels (MTP / Unified Comfort). For machines with a long service life, the visibility-toggle approach is the lowest-risk path because it survives multiple TIA Portal upgrades unchanged.
Can VBScript in WinCC Flexible 2005 add or remove items from a Symbolic IO Field at runtime?
No. The text list is a compiled resource on the TP 270 CE runtime and the Symbolic IO Field exposes no AddItem, RemoveItem, or SetTextList property. Use the visibility-toggle workaround (overlay multiple IOFields and toggle Visibility) or migrate to WinCC Unified where the data source item API is available.
How do I address a Symbolic IO Field by name from a VBScript on a TP 270?
Use HmiRuntime.ActiveScreen.ScreenItems("IOField_Name"). Replace any spaces in the screen object name with underscores. Verify the name in Properties > General > Name in the screen editor.
Why does writing to the IOField.TextList property fail with object error 0x800A01B6?
The WinCC Flexible 2005 CE runtime intentionally does not expose a writable TextList property. The native WinCC PC runtime does, but the TP 270 / OP 270 / MP 270 / MP 370 CE image omits it to keep the runtime footprint small. Plan workarounds at engineering time.
What is the most reliable workaround for a variable number of selection items?
Overlay N Symbolic IO Fields at identical X/Y coordinates, each bound to its own text list, and drive a VBScript Change Value handler on the trigger tag that sets Visibility to True only on the variant matching the active count. For dynamic scaling, use indirect tag indexing against an oversized text list.
Does WinCC Unified in TIA Portal V20 or V21 allow runtime data source manipulation?
TIA Portal V20 supports configuring a data source list at engineering time. TIA Portal V21 introduces runtime addition of data source items through the Symbol IO Field object API. Confirm the API contract for your target TIA Portal build before relying on dynamic add/remove, and reference the Siemens documentation for your exact version.