WinCC 7.5 Dynamic Text List: VBScript Configuration Guide

David Krause11 min read
HMI / SCADASiemensTechnical Reference
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

Dynamic text lists in WinCC 7.5 (Classic) enable runtime modification of operator-facing text entries without recompiling the project. Unlike static text lists compiled into the picture at configuration time, dynamic text lists are populated by VBScript at runtime from tags, file I/O, SQL queries, or referenced text lists. This reference covers the WinCC 7.5 SPx implementation path, contrasts it with WinCC Comfort/Advanced and WinCC Unified, and provides field-proven VBScript templates for tag-driven and file-driven populations used in PCS 7 V9.1 SP2 with CEMAT V6.1 environments.

Architecture note: In WinCC Classic (TIA Portal predecessor runtime), the TextList object is a configuration-time resource. There is no built-in API to append rows to it at runtime, so all dynamic content must be routed through a control that exposes a runtime-fillable Items collection (Combo Box, List Box, or the WinCC TextList DLL fed by an internal tag array).

WinCC Variant Comparison: Where Dynamic Text Lists Live

Siemens offers three text-list mechanisms across the HMI/SCADA portfolio. The script and trigger model differ between them.

Feature WinCC Classic V7.5 SPx WinCC Comfort/Advanced (TIA) WinCC Unified (TIA)
Text list object TextList (configuration-time) Text list with dynamic entries Text list with dynamized texts
Runtime extension Not directly supported — use Combo/List Box Tags, PLC text lists, or other text lists Tag-bound list and value columns
Scripting VBScript (ANSI VBS 5.6/WSC) VBScript (subset) JavaScript (ECMAScript 2021)
Trigger types Cyclic, tag, event (mouse/key) Cyclic, tag, event Cyclic, tag, event, scheduled
Multi-language export Text Library + Text DLL Project languages + reference Project languages + reference
Reference WinCC V7.5 Manual, Chapter 9 Entry ID 57025748 Dynamizing texts (Unified)

For WinCC Comfort/Advanced, the official Siemens support entry states: "You make text lists dynamic by inserting tags or other text lists. The text lists may contain both static and dynamic entries." In WinCC Unified, you dynamize the display of a text list by binding the value column to a tag and the text column to either static text or a PLC text list. The remainder of this document targets the WinCC 7.5 Classic runtime where the TextList object itself is not runtime-mutable, requiring the VBScript + Combo Box or List Box pattern.

Architecture: Why a Combo Box or List Box Replaces a Text List

The WinCC 7.5 TextList configuration object is read-only at runtime. The runtime draws selections from the entries stored in the project's Text Library and the compiled text DLLs. To display more than one line for pure visualization (read-only operator display) or to refresh content from a .txt file, COM control must be a List Box or Combo Box object because both expose the Items collection through the WinCC Graphics Runtime OCX.

Both controls are reachable from VBScript through the HMIRuntime object and the picture's ScreenItems collection:

Dim objList
Set objList = HMIRuntime.Screens("MainOverview").ScreenItems("lstDynamics")
objList.Items.Clear
objList.Items.Add "Pump P-101 - Running"
objList.Items.Add "Pump P-101 - Stopped"
objList.Items.Add "Valve V-204 - Fault"

For a read-only multi-line display, configure the Combo Box with Type = 1 (Drop-Down List) and Style = 1 (Drop-Down Combo). This disables free text entry while preserving the multi-row dropdown that behaves like a text list visualization.

Prerequisites

  1. WinCC 7.5 SPx installed with VBScript runtime enabled (default).
  2. Project opened in WinCC Explorer with picture-level scripting permitted (Graphics Designer > Tools > Settings > Allow VBScript in pictures).
  3. For PCS 7 V9.1 SP2 + CEMAT V6.1 integration: ensure the OS Project Editor has not stripped UserObjects from the master data library.
  4. Source text file accessible from the OS server runtime account; for redundancy configurations, mirror the file to both servers or place it on a UNC share that both can read.
  5. Internal tags of type Text tag 16-bit character set for tag-trigger logic, or a string tag with appropriate length (256 chars typical).

VBScript Implementation: File-Driven Dynamic Text List

The following pattern loads a .txt file (one line per list entry) and populates a List Box control. It supports optional ;-delimited filter columns and is the pattern used in CEMAT V6.1 operator overview pictures.

Place this script in a Global Action or trigger it from a button's Click event:

' --- PopulateListBox.vbs ---
Option Explicit

Const strFilePath = "C:\CEMAT_Project\Data\statuslist.txt"
Const strPicName   = "Diagnostics_Overview"
Const strListName  = "lstStatus"

Dim objFSO, objFile, objList, strLine, arrCols, i

Set objFSO = CreateObject("Scripting.FileSystemObject")
If Not objFSO.FileExists(strFilePath) Then
    HMIRuntime.Trace "PopulateListBox: source file missing: " & strFilePath & vbNewLine
    Exit Sub
End If

Set objList = HMIRuntime.Screens(strPicName).ScreenItems(strListName)
objList.Items.Clear

Set objFile = objFSO.OpenTextFile(strFilePath, 1, False, -1) ' Unicode
Do While Not objFile.AtEndOfStream
    strLine = objFile.ReadLine
    If Len(Trim(strLine)) > 0 Then
        objList.Items.Add strLine
    End If
Loop
objFile.Close

Set objFile = Nothing
Set objFSO  = Nothing
Set objList = Nothing

For filter-column behavior (show column 2 of a ;-delimited line):

arrCols = Split(strLine, ";")
If UBound(arrCols) >= 1 Then
    objList.Items.Add arrCols(1)
End If

Button-Triggered Refresh (Event-Based)

For a button that the operator clicks to refresh the list, attach the script to the button's Mouse event with Action type = VBS Action and trigger type Upon click. The downside of this approach is that the list only refreshes when the operator interacts. For continuous read-only monitoring, switch to a tag or cyclic trigger.

Tag-Triggered Refresh (Recommended for Plant Dashboards)

Create an internal binary tag trig_RefreshStatusList. On tag change (set to 1 by the source PLC or by a periodic Global Action that detects a file timestamp change), the script runs. This pattern keeps operator interaction optional while still ensuring data freshness.

HMIRuntime.Screens(strPicName).ScreenItems(strListName).Items.Clear
' ... repopulate from file ...
HMRuntime.TagSet "trig_RefreshStatusList", 0   ' reset trigger

Cyclic Trigger

For low-frequency data, configure the action as a Global Action with a cyclic trigger of 2 to 10 seconds. Avoid sub-second cycles when reading from a network share; file I/O latency will exceed the cycle window and generate MSWinSck queue overflows in the diagnostic view.

Performance guidance: For lists with more than 500 entries, switch the data source from .txt to a SQL query against the WinCC Tag Logging database or to a custom C# action accessed via CreateObject("CSharpAddIn.TagList"). Combo Box and List Box Items.Add becomes UI-thread bound above ~1000 items.

Combo Box Versus List Box: Selection Behavior

Attribute Combo Box (Drop-Down List) List Box
Display when collapsed Single selected line Multiple lines always visible
Operator interaction Optional selection Scroll, optional selection
Best for Parameter pickers, filters Read-only multi-line display
VBS property Type = 0 (drop-down), 1 (drop-down list) Multi = 0 (single) / 1 (multi-select)
Click required to view entries Yes (default) No (always open)

For pure visualization where the operator only needs to read entries without choosing, a List Box is the correct control. The list will always be expanded and will not require a click. Set the Border property to 0 to make it visually indistinguishable from a static text list.

Reading the List Box Selection

When the operator selects an entry, read the value through the Text or Index property:

Dim objList, intIdx
Set objList = HMIRuntime.Screens("Diagnostics_Overview").ScreenItems("lstStatus")
intIdx = objList.Index
HMIRuntime.Trace "Operator selected index " & intIdx & " = " & objList.Text & vbNewLine

For a selected entry that should drive a downstream action (e.g., open a faceplate), bind the Output Value property of the List Box to an internal tag of type Integer (index) or Text (display text). The downstream VBScript then reads that tag in its trigger event.

Multi-Language Dynamic Text Lists

The Text Library in WinCC 7.5 supports up to 32 languages. When loading content from a .txt file, language must be supplied externally. A common pattern is to write per-language files with the language code embedded:

C:\CEMAT_Project\Data\statuslist.en-US.txt
C:\CEMAT_Project\Data\statuslist.de-DE.txt
C:\CEMAT_Project\Data\statuslist.fr-FR.txt

Use the @CurrentLanguage WinCC system tag to route the load:

Dim strLang, strFilePath
strLang = HMIRuntime.Tags("@CurrentLanguage").Read
strFilePath = "C:\CEMAT_Project\Data\statuslist." & strLang & ".txt"
CEMAT V6.1 specific: The CEMAT AddOn pre-registers the @CurrentLanguage tag at the OS Project Editor. If a project rebuild strips it, re-enable it through the CEMAT AddOn configuration dialog before commissioning.

Integration with PCS 7 V9.1 SP2 and CEMAT V6.1

When deploying the dynamic list pattern inside CEMAT, observe the following:

  1. The CEMAT master data library (MDL) ships read-only picture templates. Place your dynamic list picture in a user-specific subfolder, e.g., GraCS\CEMAT_User\Diagnostics\, to avoid being overwritten on CEMAT Update installation.
  2. CEMAT faceplates are UserObjects and cannot host a List Box as a child. Use a separate picture (e.g., Diagnostics_Overview.pdl) and call it via HMIRuntime.BaseScreenName = "Diagnostics_Overview" from a button on the faceplate.
  3. CEMAT authorization levels (Operator, Supervisor, Engineer) map to WinCC user groups. The script must check HMIRuntime.RuntimeProject.Security.GetUserRights() before allowing the operator to trigger a refresh from external file paths.
  4. Logging: when an entry is selected and a drive command is issued downstream, the CEMAT AF_Archive logs the action. Pass the lstStatus.Index through Logging.AddEntry so the audit trail shows which dynamic list entry was the trigger.

Troubleshooting Matrix

Symptom Likely Cause Resolution
List Box shows nothing after click Script attached to Mouse action but Picture not opened with VBS enabled Graphics Designer > Tools > Settings > enable Allow VBS Action; recompile OS
Script does not fire on tag trigger Tag trig_RefreshStatusList written too fast (no edge) Add 100 ms hold-off in the source logic; or use on change in the action trigger
Items appear garbled (mojibake) OpenTextFile with wrong codepage (default ANSI) Use OpenTextFile(path, 1, False, -1) for Unicode, or -2 for system default
Operator must click to see entries Combo Box used instead of List Box Replace with List Box; set Multi = 0 for read-only single selection
Entries do not refresh on file change File locked by another process (e.g., editor) Use a sidecar .ready flag file written after atomic rename
Runtime error "Object doesn't support this property" Calling Items.Add on a TextList object instead of Combo/List Box Switch the control to Combo Box or List Box; TextList has no runtime Items collection
WinCC diagnostic viewer shows "ActiveX cannot create object" Scripting.FileSystemObject not enabled on the OS server Enable via regsvr32 scrrun.dll or use HMIRuntime.FileSystem wrapper if available

Verification

  1. Open the picture in runtime. Confirm the List Box is populated immediately if a cyclic trigger is configured, or after a single click if event-triggered.
  2. Open the WinCC Diagnostic View (Start > SIMATIC > WinCC > Diagnostic View) and confirm no VBScript errors are logged.
  3. Modify the .txt source file externally, then either click the refresh button or wait for the next cycle / tag trigger. Verify the List Box reflects the new content.
  4. Switch the operator language via the language switcher. Confirm the per-language file loads without restart of the runtime.
  5. Disconnect the source .txt file (rename it) and confirm the script logs to HMIRuntime.Trace instead of throwing an unhandled error.
  6. In CEMAT environments, verify the operator authorization level does not permit a Supervisor-only refresh path.

Security and Hardening Notes

Loading arbitrary text from a .txt file into a runtime HMI is a controlled path. Apply the following controls:

  • Restrict the .txt directory with NTFS ACLs to the WinCC runtime service account only.
  • Validate the length of each line (Len(strLine) <= 256) before adding to Items. Excessive entries degrade Items.Add performance.
  • Disallow HTML or script tokens in the source file; render text in the List Box as plain string only. WinCC's List Box does not interpret HTML, but downstream consumers might.
  • Sign the .txt file with a checksum that the VBScript validates on load to prevent operator-tampered or attacker-substituted content.

When to Migrate to WinCC Unified

The patterns above are correct for WinCC 7.5 SPx. If you are starting a new project and your runtime target is TIA Portal-based, evaluate the WinCC Unified dynamized text list model, where the text list is a first-class runtime object with tag-driven dynamization. The Comfort/Advanced model documented in Siemens Support entry 57025748 similarly supports direct tag- and text-list-bound dynamization without the Combo/List Box workaround required in Classic.

How do I populate a WinCC 7.5 text list dynamically with VBScript?

The WinCC 7.5 TextList object cannot be modified at runtime. Use a Combo Box or List Box control instead and call HMIRuntime.Screens("Pic").ScreenItems("lstX").Items.Add "text" from a VBScript action. Trigger the script on a tag change, cyclic timer (2-10 s), or button click.

What is the difference between a Combo Box and a List Box for dynamic text in WinCC 7.5?

A Combo Box displays a single selected line until the operator clicks to open the dropdown. A List Box is always expanded and shows all entries simultaneously. Use a List Box for read-only operator visualization, and a Combo Box when the operator must select a value to drive a downstream action.

How do I load a text list from a .txt file in WinCC 7.5 with PCS 7 V9.1 SP2?

Use Scripting.FileSystemObject.OpenTextFile with the -1 flag for Unicode or 0 for ASCII. Loop over the file with ReadLine, validate each line's length, and call Items.Add for each non-empty entry. Place the source file on a path accessible to the WinCC runtime service account, e.g., C:\CEMAT_Project\Data\statuslist.txt.

How do I make a WinCC 7.5 text list multi-language when loading from a file?

Use per-language files named with the language code, e.g., statuslist.en-US.txt, statuslist.de-DE.txt. Read @CurrentLanguage at runtime and concatenate the path. In CEMAT V6.1, the language tag is registered by the CEMAT AddOn OS Project Editor; if missing, re-enable the CEMAT AddOn configuration.

Can I trigger a dynamic text list refresh from a PLC tag in WinCC 7.5?

Yes. Create an internal tag (binary or integer) as a refresh trigger. Configure the VBScript action with a tag-change trigger bound to that tag. The PLC sets the tag to 1; the script runs and resets the tag to 0 at the end to provide edge detection. Avoid sub-100 ms edges; the WinCC VBScript runtime does not queue multiple triggers within the same event window.

Why does Items.Add fail with "Object doesn't support this property" in WinCC 7.5?

You are calling Items.Add on a TextList configuration object, which has no runtime Items collection. Replace the control with a Combo Box or List Box, both of which expose Items.Clear and Items.Add at runtime through the WinCC Graphics Runtime OCX.

Back to blog