1. Problem Definition and Engineering Goals
On a typical process skid, plant, or machine, an operator screen must surface dozens of analog measurements (temperatures, pressures, flows, levels, vibration amplitudes, motor currents). WinCC V7 ships with the WinCC Online Trend Control and the WinCC Function Trend Control in the Graphics Designer palette, both of which can plot one or more Trend curves against time. The naive deployment pattern—dedicating one trend window per tag—quickly breaks down once the tag count passes 20-30.
The engineering problems with that pattern are:
- Graphics Designer clutter: 30 PDL picture windows and 30 control instances to maintain.
- Runtime overhead: every Online Trend Control holds its own buffer, its own Timer thread, and its own connection into Tag Logging.
- Disk-space waste: a default acquisition cycle of 500 ms to 1 s writes ~16 bytes per archived value. With 30 tags archived at 1 s for 24 h, the Tag Logging database grows by roughly 41 MB/day raw, before any compression.
- Operator confusion: 30 windows cannot fit on a single monitor; opening and closing is slow.
The target architecture is a single Master Trend picture that opens on top of any tag the operator selects (from a button bar, alarm view, or overview picture) and renders that tag's curve on a shared time axis and value axis. This article walks through that architecture in WinCC V7.4 / V7.5 and notes the equivalent in WinCC Unified V20 where appropriate.
2. Prerequisites
| Item | Requirement |
|---|---|
| WinCC version | SIMATIC WinCC V7.4 SP1, V7.5, or V7.5 SP1 (V7.5 UD1 or later recommended for current TIA-aligned patches) |
| Edition | WinCC RT 1,500 / 5,000 / Server or WinCC RC (Runtime + Configuration) |
| Tag Logging | Licensed runtime ≥ number of archived tags + 20% headroom |
| OS | Windows 10 LTSC 2019/2021, Windows 11 Pro, Windows Server 2016 / 2019 / 2022 |
| SQL backend | Microsoft SQL Server 2017 / 2019 / 2022 (Express or Standard, bundled with WinCC) |
| Editor access | WinCC Explorer, Tag Logging editor, Graphics Designer, VBScript editor (built-in) |
| Reference | WinCC Information System (F1 in Graphics Designer) and the WinCC V7.5 "Working with WinCC" manual on the Siemens Industry Online Support portal |
WinCC Explorer → Help → About. The Trend Control COM API and VBScript object model differ slightly between V7.0, V7.2, and V7.4/V7.5. This article targets V7.4 and V7.5; V7.0/V7.2 should follow the same logic but must verify object properties against their respective WinCC Information System help.3. WinCC V7 Trend Control Architecture
A WinCC V7 trend consists of three layers that you must keep separate in your mind:
-
Process Tag (PLC): the raw data point, e.g.,
TIC_101_PV, polled from the S7 AS at the update cycle defined on the AS connection. - Internal Archive Tag (Tag Logging): the same physical value (or a calculated derivative) stored to the Tag Logging archive database at the acquisition cycle.
- Trend Control (HMI): the WinCC Online Trend Control or WinCC Function Trend Control on a PDL picture that requests data from the archive and renders it.
The Online Trend Control is bound to one or more archive tags; the Function Trend Control is bound to a user-defined function (VBScript) that returns an array of (x, y) pairs. For 30+ analog measurements, the Online Trend Control is the correct primitive because the data lives in Tag Logging and you do not want to re-sample it with a custom script every redraw.
Two key runtime properties of an Online Trend Control instance (call it Control1) are:
-
TrendTagName(index): the name of the archive tag supplying the curve. -
TimeAxis/ValueAxis: axis range, scaling, label, and format.
All three can be re-bound at runtime through VBScript or C, which is exactly the mechanism a Master Trend needs.
4. Building the Master Trend Window
4.1 Create the base picture
- Open the WinCC Explorer and switch to the Graphics Designer.
- Create a new PDL picture named
MasterTrend.PDL. - From the Controls palette, drag a WinCC Online Trend Control onto the picture. The default name is
Control1; rename it toTrendMasterfor clarity. - Open the configuration dialog of the control (Properties → Trend → Curves) and add one placeholder trend. Set its source tag to any already-archived process tag (e.g.,
TIC_101_PV_Arc). The tag name is going to be overwritten at runtime.
4.2 Configure the shared axes
- Time Axis: enable one time axis. Set Time Range = 60 min (configurable from a button bar). Enable user-defined begin/end so VBScript can rewind and zoom.
-
Value Axis: enable one value axis. Uncheck Automatic scaling and bind the lower/upper bounds to internal tags (e.g.,
@TrendYMin,@TrendYMax). This lets you re-scale per-tag without recompiling the picture. - Toolbar / Status Bar: enable the operator toolbar so the user can pan, zoom, and print without additional scripting.
4.3 Build the tag-selection bar
There are three production patterns in WinCC V7:
| Pattern | Pros | Cons |
|---|---|---|
| 30 buttons, one per tag | No scripting, easy to localize | Picture clutters beyond ~20 buttons |
| Tree view / picture window to overview | Scales to hundreds of tags | Two-click navigation |
| Alarm row double-click | Drill-down from active alarm | Requires the Alarm Control to expose the tag name |
For 30 tags, the simplest workable pattern is a button bar with two rows of 15. Each button writes the tag name into a shared internal string tag @MasterTrendSelected and then triggers MasterTrend.PDL via the OpenPicture WinCC function.
5. Dynamic Tag Assignment via VBScript
The Online Trend Control exposes its curves and axes through the runtime VBScript object model. The key pattern is select the curve, change its archive tag, optionally re-scale the value axis.
5.1 Switching the curve's archive tag
' -------------------------------------------------------------
' MasterTrend.PDL -- ConfigureTrend
' Called by every tag-selection button (Click event)
' sArcTagName : string, e.g. "TIC_101_PV_Arc"
' dYMin/dYMax : doubles, scaling for the value axis
' -------------------------------------------------------------
Sub ConfigureTrend(ByVal sArcTagName, ByVal dYMin, ByVal dYMax)
Dim oScreen, oCtrl, oAxisY
Set oScreen = HMIRuntime.Screens("MasterTrend")
Set oCtrl = oScreen.ScreenItems("TrendMaster")
' Rebind curve index 1 to the new archive tag
oCtrl.TrendTagName(1) = sArcTagName
' Force a redraw of the time axis to "now"
oCtrl.TimeAxis.BeginTime = Now - (1/24/60) * 60 ' 60 min back
oCtrl.TimeAxis.EndTime = Now
' Rescale the value axis for the selected process variable
Set oAxisY = oCtrl.ValueAxis(1)
oAxisY.Minimum = dYMin
oAxisY.Maximum = dYMax
HMIRuntime.Trace "MasterTrend -> " & sArcTagName & _
" Y=[ " & dYMin & " .. " & dYMax & " ]" & vbNewLine
End Sub
5.2 Calling the script from a button
' OnClick event of button "TIC_101"
ConfigureTrend "TIC_101_PV_Arc", 0.0, 200.0
Each button hard-codes its tag name and Y-range. If you want a single VBScript that derives the tag name from a button's text or user data, use item.Name on the button's Click event and look the tag up in a mapping dictionary.
5.3 Returning the curve to default on picture close
' Picture-close event of MasterTrend.PDL
Sub OnClose()
HMIRuntime.Screens("MasterTrend").ScreenItems("TrendMaster").TrendTagName(1) = "Default_Trend_Arc"
End Sub
TrendTagNames collection instead of the indexed property; verify in the F1 help of your specific build.6. Tag Logging Archive Optimization
A Master Trend window only renders what the Tag Logging database contains. Selecting 30 tags in a single picture does nothing for disk space; that is controlled entirely by the archive configuration.
6.1 Acquisition and archive cycles
Each archive tag in Tag Logging → Archives has two cycles:
- Acquisition cycle: how often the runtime reads the process value into memory.
- Archiving cycle: how often that value (or a compressed representative) is written to disk.
| Acquisition cycle | Archive cycle | Suitable for |
|---|---|---|
| 500 ms | 1 s | Fast loops (pressure, flow transient) |
| 1 s | 5 s | Temperature, level |
| 5 s | 1 min | Tank level, slow temperature |
| 10 s | 5 min | Ambient / utility |
| 1 min | 1 h | Energy, batch totals |
If the acquisition cycle equals the archive cycle, every value lands on disk. If the archive cycle is longer, the runtime applies the configured compression algorithm (typically Swinging Door) and stores only the values that cannot be linearly interpolated within a tolerance band.
6.2 Swinging Door compression
Swinging Door keeps the last stored value and a slope. Each new candidate value is admitted only if a line drawn between the candidate and the prior stored point would exceed the value deviation threshold set on the tag. The thresholds are configured in Tag Logging → [Archive Tag] → Properties → Compression:
- Absolute deviation: e.g., 0.5 °C for a process temperature.
- Relative deviation: e.g., 2 % of full scale.
Field experience: with a 5-minute archive cycle and 0.5 °C absolute deviation, a slow tank temperature typically archives 50-200 values/day instead of 1,440 — a 7× to 30× reduction.
6.3 Archive switching by binary signal
If a value is only interesting during a particular phase (e.g., a batch reactor), add a binary start archive tag and bind the archive to StartArchive / StopArchive events in the tag's archive configuration. Outside that phase, no values are written at all. The discussion-thread idea of gating archive writes with a binary or a script is implemented in Tag Logging through the Event-controlled archiving check-box.
7. Disk-Space Calculation
Use the formula:
Storage_per_day_bytes = N_tags x 86400 / T_archive_s x S_value
N_tags : number of archived analog tags
T_archive: archive cycle in seconds
S_value : bytes per row (16 B typical: 8 B timestamp + 8 B float)
Example: 30 tags, 5 s archive cycle, 16 B/row:
30 x 86400 / 5 x 16 = 30 x 17,280 x 16 = 8,294,400 B/day ≈ 7.91 MB/day
If Swinging Door compression at 0.5 % deviation reduces stored rows by a factor of 5, the effective growth drops to ~1.6 MB/day, or ~580 MB/year. Without compression at 1 s cycle, the same plant generates ~1.2 GB/month.
| Scenario | Cycle | Compression | 30-tag daily growth |
|---|---|---|---|
| Fast loops | 1 s | None | ~41 MB/day |
| Standard process | 5 s | None | ~7.9 MB/day |
| Standard process | 5 s | 0.5 % deviation | ~1.6 MB/day |
| Slow utility | 60 s | None | ~0.66 MB/day |
| Slow utility | 60 s | 2 % deviation | ~0.1 MB/day |
Archive files live under %ProgramFiles%\Siemens\Automation\WinCC\WinCCProjects\<Project>\ArchiveManager\Database by default. Confirm and adjust in Computer → Properties → Tag Logging → Archive Backup.
8. WinCC Unified RT Alternative
For greenfield projects on TIA Portal V20 with WinCC Unified, the trend paradigm is structurally simpler. The Unified Trend Control natively supports multiple trends in a single control, with independent or shared time axes and value axes. The configuration is described in the Siemens TIA Portal Help:
- Representing multiple trends (RT Unified) — TIA Portal V20, WinCC Unified.
The key differences vs. WinCC V7:
| Aspect | WinCC V7 (this article) | WinCC Unified V20 |
|---|---|---|
| Configuration object | WinCC Online Trend Control on a PDL picture | Trend Control widget on a Unified faceplate |
| Multiple curves | Yes, via the Curves property and VBScript | Yes, each curve can have its own value axis |
| Scripting language | VBScript, C (ANSI-C) | JavaScript |
| Time axis sharing | Single shared axis by default; switchable per curve via property | Independent or shared, configurable per trend |
| Migration | Manual port via WinCC V7 → TIA migration tool | Native |
The architectural idea — one Master Trend, dynamic source tag — remains valid in Unified; the binding is done in JavaScript against the trend's Source property.
9. Verification and Commissioning
Run through this checklist before signing off:
- Compile and OS Project Editor: run the OS Project Editor (WinCC Explorer → Tools → OS Project Editor) so that the Trend Control's runtime DLLs are deployed.
- Activate the project. Watch the WinCC Runtime startup log for missing Tag Logging tags or Trend Control licensing errors.
-
Click each of the 30 buttons in turn. Confirm:
- The new curve appears within 1 s.
- The time axis jumps to the configured begin/end (no historical drift).
- The value axis re-scales to the configured min/max.
- No yellow trend-control warning icon appears in the status bar.
- Verify archive writes: in WinCC Explorer → Tag Logging, open Tag Logging Runtime and confirm values are streaming into the configured archive.
- Stress test: open the Master Trend 20 times in 5 minutes. Verify no orphan archive handles accumulate (check WinCC Explorer → Tools → System Diagnostics).
- Backup path test: configure the archive backup path on a separate volume. Trigger an archive rollover and confirm files appear at the backup path.
10. Troubleshooting Matrix
| Symptom | Likely cause | Fix |
|---|---|---|
| Trend window opens but curve is empty | Archive tag name misspelled in TrendTagName
|
Verify the archive tag exists in Tag Logging and matches case exactly |
| Curve shows only current value, no history | Tag Logging archive cycle set to 0 or archive disabled | Open Tag Logging editor, set archive cycle ≥ acquisition cycle, restart runtime |
| Value axis flat-lined at 0 | Y-min and Y-max both 0 (VBScript wrote the same value) | Re-run the button's ConfigureTrend call with valid range |
| Slow opening of MasterTrend.PDL | Picture loading 30 invisible controls or excessive archive query | Keep only the single Online Trend Control in the picture; do not embed other controls per tag |
| Disk space climbing faster than calculated | Compression threshold too loose or archive cycle too short | Tighten deviation threshold; lengthen archive cycle |
| Trend control shows yellow triangle | Missing Tag Logging license for that tag | Check license audit under Computer → Properties → Tag Logging |
| VBScript error "Object doesn't support this property" | WinCC V7.0 / V7.2 syntax mismatch | Consult WinCC Information System F1 help for the exact Trend Control version |
| Time axis does not follow script's BeginTime | Time-axis auto-fit is enabled | Disable Automatic scaling on the time axis |
11. Field-Proven Caveats
- Don't confuse process tag and archive tag: the Online Trend Control binds to the archive tag, not the PLC tag. If you bind to a non-archive process tag, the trend will show only the current value with no history.
- Time-zone discipline: WinCC stores timestamps in UTC in the archive. Display in local time via the operator workstation's regional settings. Mixing time zones across redundant servers causes visible gaps.
- Redundant servers: archive replication between a primary and a standby WinCC server must be configured under Computer → Redundancy; otherwise the Master Trend shows gaps after failover.
- VBScript latency: a single picture's VBScript runs on the GUI thread; a 200-line ConfigureTrend that re-binds 30 curves can stall the screen for 100-300 ms. Bind only the active curve, not all of them.
- Tag Logging memory cap: a single archive holds up to ~500,000 rows in WinCC V7 by default (configurable). At 5 s cycle, that is ~29 days. Increase the segment count or shorten the cycle for longer retention.
12. FAQ
How many trends can a single WinCC V7 Online Trend Control render simultaneously?
The control itself accepts up to 80 curves per configuration, but only ~10-12 are readable on screen at once. For the Master Trend pattern, render one active curve; switch the source tag on demand via VBScript.
What acquisition and archive cycle should I use for 30+ analog tags to balance disk usage?
For typical process values (temperature, pressure, level) use a 1 s acquisition / 5 s archive cycle with a Swinging Door deviation of 0.5 %. That keeps 30-tag growth at ~1.6 MB/day on average.
How do I dynamically swap the displayed tag from a button click?
In the button's VBScript, write HMIRuntime.Screens("MasterTrend").ScreenItems("TrendMaster").TrendTagName(1) = "ArcTagName" and force a redraw by re-assigning the time-axis range.
Can the WinCC V7 Master Trend concept be migrated to WinCC Unified V20?
Yes. WinCC Unified's Trend Control natively supports multiple trends per control. The Master Trend becomes a single control whose Source is updated via JavaScript on a button click. Reference the TIA Portal V20 help page Representing multiple trends (RT Unified).
Where does WinCC V7 store Tag Logging archive files on disk?
By default under C:\Program Files\Siemens\Automation\WinCC\WinCCProjects\<ProjectName>\ArchiveManager\Database. The path can be re-targeted under Computer → Properties → Tag Logging → Archive Backup; the WinCC Information System F1 help documents the supported paths.