Configuring WinCC Professional V18 Table View — Dynamic Value Column Rename via VBScript
Overview
WinCC Professional V18 Table View controls expose a configurable column-header architecture that supports both static labels and runtime-mutable strings. Operators and engineering teams frequently need to localize, contextualize, or rebrand measured-value labels without rebuilding the screen — for example switching between Voltage (V) and Spannung (V) depending on the active user language, replacing Setpoint with Sollwert, or remapping an axis label after a recipe change in a WinCC Runtime Professional / RT Professional visualization.
The native property that drives this behavior is ValueColumnRename. The corresponding property for the time-stamp column is TimeColumnRename. Both properties belong to the WinCC Table View object model and accept string values either at engineering time inside TIA Portal V18 or at runtime through VBScript and HMI tag dynamization. The WinCC Professional V18 programming manual — entry ID 109747179 on the Siemens Industry Online Support portal — lists every property of the Table View control that can be marked dynamizable in the Animations / Properties dialog.
This technical reference walks through the complete procedure to make column headers dynamic: the exact property layout, the VBScript syntax that drives the rename, the SmartTags binding pattern, the trigger configuration, and the compiler warning ("The script does not return a value although it is defined as a 'Function'") that surfaces when the wrong sub declaration is used. The article also documents why ValueColumnName is the wrong property to assign at runtime and what to use instead.
Table View Column Rename Property Reference
The following properties are exposed by the WinCC Professional V18 Table View object. They are accessible through the ScreenItems collection of the active screen and through the HMIRuntime object in VBScript.
| Property | Type | Dynamizable | Description |
|---|---|---|---|
ValueColumnIndex |
Long | Yes | Zero- or one-based index of the value column whose header is to be renamed. Targets ValueColumnRename. Verify the indexing convention for your build in the property help. |
ValueColumnRename |
String | Yes | The actual header text rendered in the value column. Bound at engineering time as a fixed label or at runtime via VBScript / HMI tag dynamization. |
TimeColumnRename |
String | Yes | Same purpose as ValueColumnRename, applied to the time-stamp column header. |
ValueColumnName |
String | Read-only / legacy | Engineering-time reference name for the column. Used at design time in Columns configuration; do not assign to it at runtime — changes are ignored. |
ValueColumnCount |
Long | Yes | Total number of value columns configured for the Table View. Useful for iterating all columns in a loop. |
ColumnCaption |
String | Yes | Per-column caption, addressed by index. Practical alternative for multi-language scenarios where labels must be rotated independently. |
Prerequisites
Before scripting the Table View column rename, confirm the following engineering preconditions on the TIA Portal V18 engineering station and the target WinCC Runtime:
- TIA Portal V18 Update 1 or later is installed on the engineering station. The dynamic Table View property set documented here was stabilized in V18; earlier V17 SP builds and later V19 builds use the same property names but may add or rename adjacent properties — verify against your installed help set.
- WinCC Professional / WinCC Runtime Professional is licensed and visible in the TIA project tree. The Table View object is part of the WinCC Professional HMI device configuration.
-
An HMI string tag of type
String(254 characters max) orWString(Unicode) is configured under HMI Tags.Stringcovers the typical axis-label use case; switch toWStringif the project language set contains CJK, Cyrillic, or other double-byte locales. - The PLC connection or internal tag connection is compiled and error-free. Verify with Compile > Software (rebuild all) on the HMI device object.
- VBScript is enabled on the WinCC Runtime target. In TIA Portal V18 the runtime setting is found under Runtime settings > Services > Scripts > VBScript; the option "Allow VBScript" must be active. VBScript is the supported scripting language for WinCC Professional — VBS macro replacement is not the same as this.
Static Column Rename Engineering in TIA Portal V18
For projects that do not require runtime switching, the column label can be fixed at engineering time without any VBScript:
- Open the HMI screen that contains the WinCC Table View.
- Select the Table View object on the canvas; the configuration pane opens on the right.
- Switch to the Columns tab.
- In the column list, select the target value column. Open the property list (hammer icon or Properties pane).
- Enter the static label into Caption, or for explicitly separate control use the Column header text field. This becomes the runtime default for
ValueColumnRename. - Compile the HMI device and download to the RT target.
This is also the correct state against which to verify that the runtime dynamic rename works: if the static label renders correctly, the Table View object is intact and the runtime VBScript path is the only variable left.
Dynamic Column Rename via VBScript
The runtime path uses the ScreenItems collection of the active screen to obtain a reference to the Table View object, then assigns the new label to the dynamizable ValueColumnRename property. The minimum working script is:
' WinCC Professional V18 — static label rewrite via VBScript
Dim obj
Set obj = ScreenItems("Table view_1")
' Specify which value column to rename.
' Indexing follows the engineering column order configured in TIA Portal.
obj.ValueColumnIndex = 1
' Assign the new header text. "ValueColumnRename" is the
' dynamizable property; "ValueColumnName" is ignored at runtime.
obj.ValueColumnRename = "test"
Save the function inside the VBScript editor of the Table View's event. Use a Sub, not a Function, unless the script needs to return a value to its caller. The Function declaration triggers a compiler diagnostic that is described in the Common Script Errors section below.
For multi-language panels the literal "test" should be replaced by a localized resource string or by a PLC-controlled string tag, as covered in the next section.
ScreenItems(...) must match the object name shown in the TIA Portal V18 Properties > General > Name field. If the object is renamed during a refactor, every script that references it must be updated. Renaming the object does not cascade into the script references.Binding Column Names to HMI String Tags (SmartTags)
To make the column name data-driven at runtime, replace the literal string in the assignment with a SmartTags dereference. The HMI tag must already exist in the project tree and be reachable by the script context.
' WinCC Professional V18 — bind the column header to an HMI string tag
Dim obj
Set obj = ScreenItems("Table view_1")
obj.ValueColumnIndex = 1
obj.ValueColumnRename = SmartTags("HMI_Tag_4")
The HMI tag HMI_Tag_4 can be driven from the PLC via a tag connection, by a recipe, or by an internal script on another event. As soon as SmartTags("HMI_Tag_4") changes value, the next evaluation cycle of the Table View picks up the new header — provided the binding fires inside an event handler, a trigger, or a cyclic script. A direct assignment without a trigger does not auto-refresh.
Implementation checklist:
- Add an HMI tag of type
StringnamedHMI_Tag_4in HMI Tags. - If the column header is to be set by the controller, map the PLC variable to
HMI_Tag_4in the Connection configuration. For a 1200/1500 PLC the limit is 254 characters per S7 string; trim the S7 string length so thatWStringis not required. - From the PLC, write the localized label into the configured string. On a STRING [n] tag inside the controller, write the maximum length and the actual characters in the standard S7 STRING layout (
DBbyte 0 = max length, byte 1 = current length, bytes 2..n+1 = data). - Attach the script above to the OnValueChanged event of the trigger source (typically the same HMI tag, the recipe element that writes it, or an OnClick event of a Button used as a manual refresh).
- Compile the HMI, download, and verify the header updates in the running RT.
This pattern scales to all language tables. A multi-language variant can rotate SmartTags("HMI_Tag_4") among several WinCC text lists and switch the active language through the project-language configuration in TIA Portal V18.
Triggering the Rename Script at Runtime
Three trigger placements cover the typical use cases:
| Trigger | Where configured | Use case |
|---|---|---|
OnClick on a Button |
Properties > Events of the Button | Manual "Apply label" action triggered by operator |
OnValueChanged on the HMI tag or on a connected PLC tag |
Tag properties > Events | Automatic header rotation whenever the source string changes |
| Cyclic trigger (e.g. 1 s) | Scheduler orcyclic script > Trigger | Edge cases where the source value already changed before the screen loaded and a one-shot refresh is required on screen entry |
For the bound-tag approach, the OnValueChanged trigger is the most efficient. Set the trigger on the HMI tag itself (not on the Table View) and the script will be called only when the underlying string actually changes; this avoids redundant repaints on every PLC cycle.
If the Table View is hosted inside a faceplate or a library master copy, place the trigger on the faceplate tag and propagate the renamed string into the instance via the standard faceplate interface.
Common Script Errors and Compiler Warnings
Engineering feedback collected while wiring this property surfaces four recurring problems. Each is reproducible in V18 and confirmed against the script diagnostic pane.
Error: "The script does not return a value although it is defined as a 'Function'"
This warning is generated when the script block is declared as Function Name(...) but does not call Name = expression on at least one path. WinCC Professional V18 does not require a return value from a property-rewrite Sub and treats any leftover Function header as a contract violation. Replace the header with Sub for scripts that only mutate the screen:
' Wrong
Function ValueColumnNameValue(ByVal item)
Dim obj
Set obj = ScreenItems("Table view_1")
obj.ValueColumnIndex = 1
obj.ValueColumnRename = "test"
End Function
' Right
Sub ValueColumnNameValue(ByVal item)
Dim obj
Set obj = ScreenItems("Table view_1")
obj.ValueColumnIndex = 1
obj.ValueColumnRename = "test"
End Sub
Error: assigning to ValueColumnName instead of ValueColumnRename
ValueColumnName is the engineering-time reference name and is not a dynamizable property. Assigning to it executes silently and produces no visible result, which is why the heading "does not change" even though the script line reports success.
Error: using brackets [=...] for assignment
' Invalid VBScript — square brackets are not assignment operators.
Table view_1.ValueColumnIndex[=1]
Table view_1.ValueColumnName[=test]
The bracketed form is not VBScript; the runtime cannot parse it. Use the standard object/property syntax with the = operator, as shown in the working examples above.
Error: object not found in ScreenItems
When the object name passed to ScreenItems(...) does not match the configured object name, WinCC raises an automation error and the script aborts before the assignment happens. Verify the object name in the TIA properties pane and avoid embedded spaces that differ between display name and engine name.
Multi-Column Rename with ValueColumnIndex
Many Table Views display two or more value columns side by side (for example "Voltage" and "Current"). Loop through the columns and rename each in turn from a tag array or a dictionary:
' Rename every value column in the Table View in a single event
Dim obj
Dim i
Dim labelNames
Set obj = ScreenItems("Table view_1")
labelNames = Array("Voltage", "Current", "Power")
For i = LBound(labelNames) To UBound(labelNames)
obj.ValueColumnIndex = i
obj.ValueColumnRename = labelNames(i)
Next
Bind each label to its own HMI string tag if individual languages or unit suffixes are required, or drive the array from a single recipe element of a user-defined type.
Verification and Acceptance Test
After the script has been wired, use the following acceptance test on the WinCC RT target to confirm correct behavior end-to-end.
- Start the WinCC Runtime Professional simulation from TIA Portal V18 (Start > Run > Start Runtime) or boot the real RT PC.
- Open the screen that contains the Table View. Confirm the engineering-time default header is rendered.
- Force a change to the bound HMI tag — through the PLC, through a tag simulation, or by writing to the internal tag from a separate event handler.
- Verify the column header updates within one PLC cycle (for tag binding) or one button press (for click trigger). The change is immediate on the next paint cycle of the runtime.
- Cycle the project language in TIA Portal (or via the language switch on the RT) and confirm that
ValueColumnRenamestill resolves to the current locale. This validates that the assignment is not silently cached against a single locale. - Open the HMI diagnostics viewer (WinCC Explorer > Tools > Diagnostics) and inspect the diagnostic log for any VBScript runtime errors associated with the screen; clean entries confirm a healthy rename path.
Troubleshooting Matrix
| Symptom | Likely root cause | Corrective action |
|---|---|---|
| Column header never changes after click | Script assigned to ValueColumnName instead of ValueColumnRename
|
Switch the assignment target to the dynamizable ValueColumnRename property |
| Header changes when literal is used, never when a SmartTag is used | Trigger not wired, or trigger fires on a different tag than HMI_Tag_4
|
Wire the OnValueChanged trigger on the HMI tag that was bound, or call the script from a Button OnClick |
| Compiler warning: "The script does not return a value although it is defined as a 'Function'" | Script declared as Function but does not return a value |
Change the header to Sub; this script does not need a return value |
| Script runs but the screen flickers for the wrong column |
ValueColumnIndex not set, or set to a column outside the configured list |
Set ValueColumnIndex explicitly before ValueColumnRename; verify the column order in the Columns tab |
Automation error on ScreenItems(...)
|
Object name in script does not match the configured object name | Open Properties > General > Name and copy the exact string into the script |
| Header shows "####" or "???" after string change | HMI tag length exceeds column header width or contains an unsupported character set | Switch the source tag to WString for Unicode support; constrain the header length to 254 characters (String) |
| Header updates once at start, then never again | Trigger type is "OnLoad" rather than "OnValueChanged" | Change trigger to OnValueChanged on the HMI tag or attach to OnClick of a Button |
Best Practices and Field Notes
- Centralize the rename script in the project library so every screen that uses a Table View pulls the same function. This eliminates drift between screens and makes locale switches maintainable.
-
Use the same
ValueColumnIndexrange across the project — index 0 is the first column in TIA's table configuration, and a consistent indexing convention prevents off-by-one mistakes between screens. -
For multi-language projects, prefer
WStringHMI tags overString; some Eastern European and Asian locales use double-byte encodings thatStringtruncates. - Avoid renaming on every PLC scan. If the column header rarely changes (it usually should not — operators read headers, not scripts), drive the assignment from a discrete event (button, recipe change) rather than a cyclic trigger. This keeps the runtime overhead flat.
- Treat the Table View header as a presentational element, not a control signal. Operators rely on stable labels; rename only when the meaning of the data has genuinely shifted (locale change, unit change, recipe change), not on every screen refresh.
- Verify against Siemens entry 109747179 whenever a project is upgraded. TIA Portal V19 may introduce new column-related properties; check the property help in the installed build before porting the script verbatim.
-
Document the
SmartTagin the HMI tag table with a comment indicating which screen consumes the value and which column it labels, so that follow-on engineering does not accidentally repurpose the tag.
FAQ
Which property do I use to rename a WinCC V18 Table View value column at runtime?
Use the dynamizable ValueColumnRename property on the Table View object. The legacy ValueColumnName property is not dynamizable and runtime assignments to it have no effect.
How do I bind the column header to an HMI string tag?
Assign obj.ValueColumnRename = SmartTags("HMI_Tag_4") in a Sub and trigger that Sub from the OnValueChanged event of HMI_Tag_4. The tag type should be String (254 chars) for Latin locales or WString for Unicode locales.
Why does my script trigger the warning "does not return a value although it is defined as a 'Function'"?
The script is declared as a Function but does not return a value on every path. WinCC Professional V18 flags this as a contract violation. Replace the Function header with Sub — the column rename does not need to return a value.
Can I rename more than one value column at the same time?
Yes. Loop through the column indices with obj.ValueColumnIndex = i and assign each obj.ValueColumnRename from an array of labels, a recipe, or a series of HMI string tags. The runtime updates all headers in one event.
What is the official Siemens documentation reference for the property list?
The WinCC Professional V18 programming manual, entry ID 109747179 on the Siemens Industry Online Support portal, lists every property of the Table View that can be marked dynamizable in the Properties dialog.