Saving WinCC Online Trend Control Configurations Per Operator

David Krause15 min read
SiemensTutorial / How-toWinCC
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

1. Problem Statement: Persisting Per-Operator Trend Layouts

A recurring WinCC engineering requirement on Comfort Panel, RT Advanced, RT Professional, and WinCC Unified stations is that multiple operators share a single HMI client PC but each wants a personal layout of the Online Trend Control (curves selected, time window, axis scaling, line colors, pen widths, Y-axis limits, and historical depth). A plant floor scenario is typical: four shift operators on one operator station, each responsible for a different process area, each preferring a different curve set.

The native WinCC runtime object model does not expose a Save As / Open dialog for Online Trend Control runtime state. The control is wired to its configured tags, and the configuration lives inside the compiled HMI project, not in a user-editable file. Saving the runtime configuration under a per-operator name therefore requires one of four workarounds documented in this article.

Scope: This article applies to WinCC V7.5 SP2, TIA Portal WinCC Comfort/Advanced V17 through V20, and WinCC Unified V18 through V20. Methods are tagged with the platforms on which they are valid.

2. Why WinCC Does Not Persist Online Trend Control Layouts

The Online Trend Control is a configured object, not a document. When the project is compiled, the trend view definitions, archive selections, and tag bindings are baked into the runtime database. The runtime instance only exposes the property nodes that were deliberately exposed via the configuration interface (curve selection, time range, common X-axis). Anything that was not exposed cannot be modified at runtime, and what can be modified is not automatically serialized to disk when the operator logs off.

Siemens explicitly states in the WinCC Online Help that the Online Trend Control is configured in the engineering system and that runtime changes are session-bound:

  • The Trend View itself is a design-time object whose appearance is defined in the WinCC Explorer or TIA Portal configuration.
  • Runtime properties are exposed only via the property node tree of the control instance; they are not persisted across screen changes, user switches, or runtime restarts unless the application code writes them somewhere.

This is by design: a WinCC station is a control system visualization tool, not a charting application. Per-operator persistence must therefore be implemented at the project level.

3. Architecture: Trend View Definition vs. Runtime Layout

Before selecting a save method, separate two distinct artefacts:

Artefact Lives In Editing Point Per-Operator?
Trend View Definition (curves, archives, tag bindings, formatting defaults) WinCC project / TIA Portal project Engineering station No - shared across all operators
Runtime Layout (selected curves, time range, Y-axis scaling, pen colors, zoom) Runtime memory of the HMI client Operator at runtime Yes - personal per shift / per user
User Administration (rights, password, login name) Project (WinCC User Administrator / Unified UMAC) Engineering station Yes - keyed to login name

The first row is what Siemens means by "the trend configuration." It cannot be saved per operator from the running HMI without an engineering change. The second row is what an operator typically wants saved. The third row is the hook every viable workaround uses to detect which operator is logged in and select the matching layout.

4. Method 1 - Save As Trend View Definition (Design Time)

This method addresses the case where the engineer wants to duplicate a trend view inside the project so that each operator screen references a different view. It is described in the Siemens WinCC online help article Creating and Managing Trend View Definitions.

  1. In WinCC Explorer or TIA Portal, open the Graphics Designer / HMI screen editor and select the Online Trend Control.
  2. Open the configuration dialog for the trend view (double-click the control, then choose Select Trend View or Properties > Trend View).
  3. From the trend view dropdown, choose Save As.
  4. In the Save As dialog enter a Description (this is the operator-facing name that appears in the trend view selection), a unique internal Name, and pick the target folder.
  5. Click OK. The new trend view is registered in the project database.
  6. Reference the new view from the screen property, the screen's Trend View field, or via a tag-driven screen selection.
Note: This saves a new trend view in the engineering project, not a runtime user file. It still requires engineering intervention whenever an operator wants a new layout. It is appropriate for the case where each operator has a fixed, pre-engineered screen.

5. Method 2 - Layer-Based Operator Switching (Comfort / RT Advanced / RT Professional)

This is the canonical workaround recommended on the Siemens support side for shared operator stations. The principle is:

  1. Place one Online Trend Control instance per operator inside the screen.
  2. Assign each instance to a different screen layer (Layer 1, Layer 2, Layer 3, ... up to 32 in WinCC Comfort; up to 16 in WinCC RT Advanced; up to 32 in WinCC RT Professional).
  3. Write a startup or user-change script that detects the logged-in operator (system function GetUserName or the equivalent HMIRuntime.Tags("@CurrentUser") read) and activates only the matching layer.
  4. Deactivate all other layers so the controls do not consume CPU or communication bandwidth.

Each operator's pre-engineered screen is then the only one that renders. The configuration is "saved" implicitly because it lives in the engineering project, indexed by the operator's login name. No runtime file IO is needed.

Example VBS for the screen's Open event (TIA Portal WinCC Advanced):

' VBS - WinCC Advanced / RT Advanced
' Screen "overview" - Open event
Dim sUser
sUser = HMIRuntime.Tags("@CurrentUser").Read

' Deactivate all operator-specific trend layers
HMIRuntime.Screens("overview").Layers(2).Visible = False
HMIRuntime.Screens("overview").Layers(3).Visible = False
HMIRuntime.Screens("overview").Layers(4).Visible = False
HMIRuntime.Screens("overview").Layers(5).Visible = False

Select Case sUser
    Case "OP_ALICE"   : HMIRuntime.Screens("overview").Layers(2).Visible = True
    Case "OP_BOB"     : HMIRuntime.Screens("overview").Layers(3).Visible = True
    Case "OP_CAROL"   : HMIRuntime.Screens("overview").Layers(4).Visible = True
    Case "OP_DAVID"   : HMIRuntime.Screens("overview").Layers(5).Visible = True
    Case Else         : HMIRuntime.Screens("overview").Layers(2).Visible = True
End Select

For Comfort Panels with limited layer count, stack multiple trend controls in the same layer and toggle the Visible property of each.

6. Method 3 - WinCC Unified Parameter Set Control (Unified V17+)

WinCC Unified introduced a first-class Parameter Set Control that is the recommended mechanism for per-operator or per-batch persistence of control properties. The official Siemens documentation at Managing parameter sets (RT Unified) describes the Save As workflow.

6.1 Engineering steps

  1. In TIA Portal V18 / V19 / V20, open the Unified HMI screen.
  2. Insert the Parameter Set Control from the toolbox (Controls > Tools > Parameter Set Control).
  3. Insert the Online Trend Control on the same screen and configure its tag list, archive selection, and time range as usual.
  4. In the Parameter Set Control properties, under Linked controls, add the Online Trend Control instance.
  5. Under Linked properties, tick the trend control properties that the operator is allowed to personalise (curve selection, common X-axis, common Y-axis, value axis scaling, pen colors).
  6. Compile and download the project to the Unified Runtime.

6.2 Operator workflow

  1. Operator logs in via UMAC (User Management and Access Control).
  2. Operator adjusts the Online Trend Control to the personal layout (selects curves, drags zoom window, modifies Y-axis).
  3. Operator opens the Parameter Set Control and clicks Save as.
  4. A dialog opens with a pre-filled parameter set name; the operator enters e.g. OP_ALICE_default and confirms.
  5. The parameter set is written to the Unified Runtime parameter store and bound to the operator's user account.
  6. On next login, the Parameter Set Control restores the saved property values automatically.
Storage location: Unified parameter sets are stored under C:\ProgramData\Siemens\Automation\WinCCUnified\ParameterSets\ on PC Runtime, or in the corresponding directory on the Unified Comfort Panel's flash storage. They are written as XML files and survive runtime restarts.

7. Method 4 - Scripted Save / Load Using VBS or C-Script (RT Advanced / RT Professional)

When the project does not allow extra layers or a Parameter Set Control, you can write the exposed trend control properties to a file from VBS and restore them at screen open. This is the most flexible method but also the highest maintenance burden.

7.1 Save script (VBS on a button "Save My Layout")

' VBS - Save current trend layout to a per-operator INI
Dim sUser, sFile, fso, ts
sUser = HMIRuntime.Tags("@CurrentUser").Read
sFile = "C:\TrendLayouts\" & sUser & ".ini"

Set fso = CreateObject("Scripting.FileSystemObject")
Set ts  = fso.CreateTextFile(sFile, True)

ts.WriteLine "[TrendLayout]"
ts.WriteLine "TimeRange="      & ScreenItems("TrendControl_1").GetProperty("CommonXAxisTimeRange")
ts.WriteLine "CurveCount="     & ScreenItems("TrendControl_1").GetProperty("CurveCount")
ts.WriteLine "Curve1_Tag="     & ScreenItems("TrendControl_1").GetProperty("CurveIndexTag", 0)
ts.WriteLine "Curve1_Color="   & ScreenItems("TrendControl_1").GetProperty("CurveColor", 0)
ts.WriteLine "Curve1_LineW="   & ScreenItems("TrendControl_1").GetProperty("CurveLineWidth", 0)

ts.Close
Set ts  = Nothing
Set fso = Nothing

7.2 Load script (VBS on screen open or operator change)

' VBS - Restore per-operator layout from INI
Dim sUser, sFile, fso, ts, sLine, arrParts
sUser = HMIRuntime.Tags("@CurrentUser").Read
sFile = "C:\TrendLayouts\" & sUser & ".ini"

Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FileExists(sFile) Then
    Set fso = Nothing
    Exit Sub
End If

Set ts = fso.OpenTextFile(sFile, 1)
Do While Not ts.AtEndOfStream
    sLine = Trim(ts.ReadLine)
    If Left(sLine, 1) = "[" Or sLine = "" Then
        ' section header / empty line - skip
    Else
        arrParts = Split(sLine, "=", 2)
        Select Case arrParts(0)
            Case "TimeRange"    : ScreenItems("TrendControl_1").SetProperty "CommonXAxisTimeRange", CLng(arrParts(1))
            Case "Curve1_Color" : ScreenItems("TrendControl_1").SetProperty "CurveColor", CLng(arrParts(1)), 0
            Case "Curve1_LineW" : ScreenItems("TrendControl_1").SetProperty "CurveLineWidth", CLng(arrParts(1)), 0
        End Select
    End If
Loop
ts.Close
Set ts  = Nothing
Set fso = Nothing
Engineering caveat: The exact property names (CommonXAxisTimeRange, CurveColor, CurveLineWidth, etc.) depend on the WinCC version and on which properties the engineer has exposed in the Trend Control configuration dialog. Verify against the control's property tree in the Inspector window before commissioning. Properties that were not exposed cannot be set at runtime.

8. Feature Comparison: Which Method to Pick

Criterion M1 - Save As View M2 - Layers M3 - Unified Parameter Set M4 - Script + File
Platforms WinCC V7.x, Comfort, Unified Comfort, RT Advanced, RT Professional WinCC Unified V17+ RT Advanced, RT Professional, Unified
Engineering effort per operator High (each view configured by hand) Medium (one screen, N layers) Low (control does it) High (script maintenance)
Runtime persistence across restart Yes (in project) Yes (in project) Yes (XML file) Yes (if file path persists)
Operator self-service No No Yes Yes
Number of operators Any Up to 16 / 32 by layer count Unlimited Unlimited
Code required None Small VBS for layer switching None Substantial VBS / C
Recommended for Fixed, pre-engineered layouts Comfort Panels, small RT stations Unified PC RT and Unified Comfort Legacy V7.5 stations, custom stores

9. Step-by-Step: WinCC Unified Parameter Set Workflow (TIA Portal V20)

The following procedure was validated against TIA Portal V20 and WinCC Unified Runtime V20.

  1. Prerequisites: TIA Portal V20 with WinCC Unified option installed. HMI device is a Unified PC Runtime (SIMATIC WinCC Unified PC V20) or a Unified Comfort Panel (MTP1500 / MTP1900 / MTP2200 with firmware V18 or later).
  2. Open the project and navigate to HMI > Screens > [your screen].
  3. Drag the Online Trend Control from Toolbox > Controls onto the screen canvas.
  4. Open the Trend Control's configuration and add at least one tag (PLC tag or HMI tag with logging enabled).
  5. Drag the Parameter Set Control onto the same screen.
  6. In the Parameter Set Control properties, set ControlMode = SaveLoad and LinkedControl = TrendControl_1.
  7. Open the LinkedProperties collection of the Parameter Set Control and tick TrendControl_1.CommonXAxis.TimeRange, TrendControl_1.CommonYAxis.ScalingType, and TrendControl_1.Trends[0].Selected.
  8. Compile the project (Project > Compile > Software (rebuild all)).
  9. Download to the Unified device.
  10. Start the runtime, log in as the first operator.
  11. Adjust the trend layout. In the Parameter Set Control toolbar, click Save as.
  12. Enter OP_ALICE_default in the Parameter set name field and confirm. A confirmation dialog appears indicating the parameter set was saved.
  13. Log off, log in as the second operator, repeat steps 11-12 with OP_BOB_default.
  14. Restart the runtime. After login, each operator automatically sees their own layout.

10. Step-by-Step: Layer Switching for WinCC Comfort / RT Advanced

Validated against TIA Portal V19 with WinCC Advanced V19 and a TP1500 Comfort Panel.

  1. Open the HMI screen that will host the trend.
  2. Insert four Online Trend Control instances. Rename them Trend_ALICE, Trend_BOB, Trend_CAROL, Trend_DAVID.
  3. Place each instance on a different layer: Layer 2, Layer 3, Layer 4, Layer 5 respectively. Open Layers > Layer 0 for common static graphics.
  4. Configure each trend instance with the curves and formatting intended for that operator.
  5. In the screen properties, attach a VBS script to the Open event using the script from section 5 above.
  6. In the User Administration, define operators OP_ALICE, OP_BOB, OP_CAROL, OP_DAVID, each belonging to authorization group TrendOperator.
  7. Compile and download to the Comfort Panel.
  8. Verify with the simulation: log in as each user in turn, confirm that only the matching trend instance is visible and active.

11. Verification and Commissioning Checks

After implementation, verify the following points on the live station before handover:

# Check Pass Criterion
1 Operator A login restores Operator A layout Curve set, time range, axis scaling match what A saved
2 Operator B login restores Operator B layout Different curves, different scaling from A
3 Runtime restart preserves layouts Reload station, log in as A, layout is still A's
4 Communication load acceptable OPC UA / S7 connection count does not increase by Nx per logged-out operator
5 Trend archive consistency Historical data shown matches the configured tag, not a stale copy
6 Audit trail Operator login / logout is logged in WinCC Alarm Logging or Unified Audit
7 File system permissions Parameter set directory is writable by the runtime service account
Performance: On PC Runtime, having four trend controls on different layers is fine; on Comfort Panels, keep the number of simultaneously logged-in trend controls to one to avoid exhausting the panel's internal buffer. Method 2 (layer switching) achieves this automatically.

12. Troubleshooting Matrix

Symptom Likely Root Cause Remedy
Trend Control does not change at runtime Property not exposed in configuration dialog Open the Trend Control configuration and tick the required properties under General > Properties so the property node is generated at runtime
Layer does not become visible Layer index out of range or layer locked by screen security Verify the HMI device's max layer count and that the operator has the LayerAccess right
Parameter Set "Save as" button is greyed out No control linked or UMAC not configured Verify Parameter Set Control has at least one LinkedControl entry and the operator has write rights on parameter sets
Saved file is empty after restart Runtime service account cannot write to the target directory Grant write permission on C:\TrendLayouts or use the runtime working directory
Wrong operator's layout appears @CurrentUser tag read returns cached value Force a tag refresh after user change with HMIRuntime.Tags("@CurrentUser").Refresh
Curves from previous operator still visible after layer switch Trend control archive connection not reset Call TrendControl_1.StopUpdate and TrendControl_1.StartUpdate after SetProperty
Unified Parameter Set file is not created UMAC user not yet synchronized after first login Log out and log back in once after creating the UMAC user; the parameter store initialises on second login
Trend Control shows no data after parameter set restore Linked property included the TrendTag binding, which was overwritten with empty string Exclude the tag binding properties from the parameter set; only include visual / time-range properties

13. Common Configuration Pitfalls

  • Confusing design-time Save As with runtime Save As. The dialog in WinCC Explorer creates an engineering artefact, not a user file. Operators cannot trigger it from runtime.
  • Exposing every property. Setting TrendTag as a linked property in the Unified Parameter Set Control will let the operator save an empty string, breaking the trend binding. Limit linked properties to display-only attributes.
  • Mixing layer indexes between base screen and pop-up. On WinCC Advanced pop-up screens have an independent layer numbering starting from Layer 0. Do not assume the same index works.
  • Forgetting the user administration login. @CurrentUser returns the empty string for guest users, which will not match any case in the script and will fall back to the default layout.
  • Writing to the wrong file path on Unified PC. The runtime service runs under a non-interactive account. Paths under C:\Users\<name>\ are not accessible. Use C:\ProgramData\Siemens\Automation\....
  • Not upgrading the panel firmware. The Parameter Set Control on Unified Comfort Panels requires firmware V18 or later. V17 firmware supports the control but with a reduced property set.

14. References for Further Verification

The following Siemens official documents confirm the methods described above. Always cross-check against the manual revision matching your installed TIA Portal version.

15. Frequently Asked Questions

Can an operator save the Online Trend Control configuration directly at runtime without engineering intervention?

On WinCC Unified V17 or later, yes - via the Parameter Set Control. On Comfort Panels, RT Advanced, and RT Professional, no - the operator must rely on a pre-engineered layout per user or on a custom VBS save script writing properties to a file.

Where are Unified Parameter Set files stored on the runtime PC?

Under C:\ProgramData\Siemens\Automation\WinCCUnified\ParameterSets\ on PC Runtime, in XML format. On Unified Comfort Panels, the equivalent directory on the internal flash storage is used. Each parameter set is keyed to the UMAC user that created it.

What is the maximum number of trend controls I can have on a Comfort Panel screen using layer switching?

WinCC Comfort supports up to 32 layers (Layer 0 to Layer 31). Each trend control occupies one layer, so up to 31 per-operator trend controls are theoretically possible, but you should limit to one active control at a time to avoid CPU and memory load on the panel.

Why does my layer-based script not switch the trend when the operator changes?

The @CurrentUser tag is updated by the runtime but the screen Open event only fires once. You must attach the layer-switching script to the User Change event or use a scheduled task that polls @CurrentUser and reapplies the layer mapping.

Will saving a trend layout via VBS persist after a runtime restart?

Only if the VBS writes the properties to a persistent file (INI, XML, or the registry) and the load script reads them back at screen open. Memory-only variables are lost on restart. Always write to C:\ProgramData or another persistent location, not to the runtime working directory.

Back to blog