WinCC Tag Logging: Configuring Historical Trend Archives

David Krause12 min read
HMI / SCADASiemensTutorial / How-to
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

WinCC Historical Trend Architecture

Siemens WinCC (V7.x and the TIA Portal WinCC Runtime variants) separates high-speed process acquisition from long-term history through a two-tier model: Tag Logging Fast for sub-second process values, Tag Logging Slow for minute/hour-class data, and Alarm Logging for message events. A historical trend in WinCC is therefore not a property of the tag itself but of an archive variable inside one of these three log types, displayed by a WinCC Online Trend Control or WinCC Online Table Control on a process picture.

The runtime data path is: process tag → acquisition cycle → archive buffer → swap segment on disk (\\ArchiveManager\TagLoggingFast, TagLoggingSlow, AlarmLogging) → optional Storage Plus export → optional central archive server. Understanding this chain is critical when configuring retention targets of 1–5+ years, because local segments alone rarely hold that volume reliably without planning.

PLC Tag(WinCC Tag) Acquisition(e.g. 500 ms) Archive Buffer (RAM) Swap Segment (Disk) Storage Plus Central Archive Server WinCC data path: tag → archive → display → export Display layer WinCC Online Trend Control WinCC Online Table Control WinCC Trend/Archive Reports (.csv export)

Prerequisites

  • WinCC V7.x (V7.4 SP1 or later recommended) or TIA Portal V16+ WinCC Runtime Professional, installed with the Tag Logging and Alarm Logging components. Verify in the WinCC Explorer that the editors are present; if missing, run the WinCC setup and add them.
  • For retention beyond the typical 6–12 month local swap, license and install the SIMATIC WinCC/Storage Plus option (SIEMENS article ID 29644083 documents the relevant configuration for multi-year archives).
  • A WinCC project with process tags already defined (internal or PLC-linked via S7-1500, S7-1200, OPC UA, or Modbus TCP).
  • Disk sizing validated: a 5-year, 100-tag archive at 1 sample/second requires roughly 50–60 GB raw (compressed .lbf segments typically achieve 40–60% reduction vs. raw 8-byte float logging).
  • Runtime deactivated before any archive reset or re-configuration that touches segments.
Important: Stop WinCC Runtime before modifying segment times, archive backup paths, or resetting archives. Changes to active archives can corrupt the open swap segment.

Creating a Tag Logging Archive

  1. Open WinCC Explorer and expand Tag Logging. The default tree contains TagLoggingFast, TagLoggingSlow, and Alarm Logging. Right-click TagLoggingSlow → New Archive if you need a separate long-term archive (recommended when mixing slow background data with fast process data).
  2. Right-click the new archive → Rename (e.g., Process_Hist_5Y) and open its Properties dialog.
  3. On the General tab, set:
    • Archive type: Tag Logging Slow (process values) or Tag Logging Fast (sub-second acquisition).
    • Storage location: default \<Project>\ArchiveManager\TagLoggingSlow or a dedicated network share when using Storage Plus.
  4. Confirm with OK; the archive appears in the tree and is ready to receive archive variables.

The same workflow applies under Alarm Logging for message-driven historical logs. Each archive is independent: you may run 1 day per segment locally and export completed segments daily to Storage Plus, while keeping 14 days hot on disk for the trend control.

Configuring Archive Variables and Acquisition Cycles

Open the archive, then click Archive Variables in the right pane. Add variables either by drag-and-drop from the tag tree or via the wizard. For each archive variable, configure:

Parameter Typical Value Purpose
Acquisition cycle 500 ms, 1 s, 5 s, 1 min How often Runtime samples the source tag into the archive buffer.
Archiving cycle = acquisition, or decimated (e.g., 1 min) How often a buffered value is committed to the swap segment.
Compression None / Swing-Door / 1-of-n Reduces segment size; Swing-Door requires tolerance per variable.
Trigger Time-based / Tag-based / Event-based Tag-based triggers (e.g., on batch start) are common for 5-year archives where continuous logging would be wasteful.
Range limits Lower / Upper Reject noise and out-of-range values before they hit disk.

For a 5-year retention target, common field-proven selections are:

  • Acquisition 1 s, archiving 1 min, compression Swing-Door ε=0.5% for analog process values.
  • Acquisition 100 ms, archiving 1 s, no compression only for fast control loops where post-event analysis requires full fidelity.
  • Event-driven (batch start / stop) for totals and counters.

Segment Sizing Calculations

Each archive is divided into segments of fixed time span (commonly 1 day, 1 week, or 1 month). WinCC closes a segment when its time window elapses and opens a new one. Segment size determines the swap file footprint and the rollback window available if Runtime is stopped abruptly.

Use the following dimensional formulas to size segments:

Samples_per_segment = (Segment_duration_seconds) / (Archiving_cycle_seconds)
Bytes_per_segment   = Samples_per_segment * N_tags * (16 + 8 + timestamp_overhead)
                     ≈ Samples_per_segment * N_tags * 32 bytes (typical lbf record)
Annual_volume       = Bytes_per_segment * (Segments_per_year)
5y_volume           = Annual_volume * 5

Worked example — 100 tags, 1 s archiving, 1-day segments:

Samples_per_segment = 86400 s / 1 s        = 86 400 samples/tag
Bytes_per_segment   = 86 400 * 100 * 32   = 276 480 000 B ≈ 264 MB
Annual volume       = 264 MB * 365        ≈ 94 GB
5-year volume       = ≈ 470 GB raw

With Storage Plus compression (40–60% typical for analog process data), 5-year footprint drops to ~200–280 GB. Always size the disk with a 30% free-space margin: Disk ≥ (5y_volume * 1.3).

Field caveat: If the calculation shows a daily segment above ~500 MB on a slow disk (network share, SATA, RAID-5), reduce the segment time or compress aggressively. Large segments prolong Runtime startup because WinCC reads the segment header index on activation.

Inserting and Configuring WinCC Trend Control

  1. In Graphics Designer, open the target process picture.
  2. Drag WinCC Online Trend Control from the Smart Library / Control palette onto the picture.
  3. Open Configuration → Trend and click Add… to bind a trend to one or more archive variables. Choose the Source dialog tab and select the archive variable from your Process_Hist_5Y archive.
  4. Switch the Time axis to Display historical data and set:
    • Begin: Time range → Time range as configured, or Start time = relative offset (e.g., now - 30 d) for fixed-window displays.
    • Update cycles: 1 s for live, 5–10 s for historical only (lower load on Runtime).
  5. For a fixed historical window (e.g., the last completed batch), use the TrendOnlineConfiguration.TimeRange properties:
    szTimeRange = "00:00:00;00:00:00"
    szStartTime = "2024-01-01 00:00:00"
    szEndTime   = "2024-01-02 00:00:00"
  6. Add a Time range buttons toolbar element so operators can step 1 h / 8 h / 1 d / 1 w / 1 mo without operator-side scripting.

For tabular output (audit, regulatory reports), drop a WinCC Online Table Control on the same picture and bind it to the same archive variables. Enable Print and Export CSV properties if operators must hand off data to MES or external QA systems.

Long-Term Storage with Storage Plus

Storage Plus is a licensed WinCC option (separate install media or part of WinCC/Storage Plus package) that swaps completed archive segments out of the local swap directory to long-term media — typically a NAS, an SQL-backed central archive, or a tape target — while presenting the historical timeline seamlessly to the trend control. Reference: Siemens Support entry 29644083 — Tag Logging long-term archive configuration.

  1. Install Storage Plus on the WinCC server and on every operator station that should display multi-year history.
  2. In WinCC Explorer, right-click Tag Logging → Storage Plus Configuration.
  3. Define a Storage path (UNC network share, e.g., \\nas01\histdata\plantA) and a Storage medium (Central Archive Server, NAS, or removable drive).
  4. Set the Export mode:
    • Time-controlled: export each closed segment after X hours.
    • Size-controlled: export when the local archive exceeds N MB.
    • Manual: operator or scheduled script (VBS in WinCC).
  5. Set retention policy: Delete from local after successful export = yes (recommended); Keep local copies = 14 days hot for fast operator paging.
Redundancy note: Without Storage Plus and a redundant WinCC server pair, a single disk failure on the Runtime server can destroy years of history. Always pair Storage Plus with either RAID-1/10 local disks or a redundant server (WinCC/Redundancy license).

Backup, Redundancy, and Central Archive Strategies

Strategy Storage Target Retention Cost Best Use
Local swap only Server disk 1–6 months typical Lowest Demo, small lab
Storage Plus → NAS SMB/CIFS share 1–5 years Low Plant historians without central IT
Storage Plus → CAS (Central Archive Server) WinCC CAS SQL 5–10 years Medium Multi-server fleets
Storage Plus + WinCC/Redundancy Two servers mirrored 5–10 years High Regulated / Tier-1 process
WinCC → Process Historian / PCS 7 OS Historian Central SQL/OSIsoft PI bridge 10+ years High Enterprise-wide analytics

For 5-year retention on a single server without Storage Plus, the realistic maximum is roughly 1 year at 1 s / 100 tags. Anything beyond that requires either Storage Plus, a decimation strategy (1 s → 1 min after 30 days, 1 min → 15 min after 1 year), or an external historian.

Resetting Archives with WinCC ArchiveManager

To clear historical data (for example, after a project re-commissioning, or before shipping a pre-configured machine), use the in-built ArchiveManager:

  1. Stop WinCC Runtime.
  2. Open Start → SIMATIC → WinCC → Tools → ArchiveManager.
  3. Select the project, then expand TagLoggingFast, TagLoggingSlow, and Alarm Logging in turn.
  4. Right-click each archive → Reset. Confirm the warning dialog. ArchiveManager deletes the swap segments and rebuilds the headers.
  5. Repeat for every archive that holds data you want to discard.
  6. Restart Runtime and verify in the Online Trend Control that the time axis begins at the current timestamp.
Alternative — manual cleanup: You can also stop Runtime and delete the contents of \<Project>\ArchiveManager\TagLoggingFast, \…\TagLoggingSlow, and \…\AlarmLogging. ArchiveManager performs the same operation with header rebuild, which is safer than raw file deletion if any segments were open or partially written.

For Storage Plus targets, the reset does not propagate. To clear the central archive as well, use the Storage Plus configuration dialog → Maintenance → Delete external archive, or delete the matching folders under the configured Storage path.

Performance Tuning and Best Practices

  • Decimation pyramid: log raw at 1 s for 30 days, decimate to 1 min for the next 11 months, decimate to 15 min thereafter. Configure as separate archive variables pointing to the same source, with their own archiving cycle and segment time.
  • Archive variable count: keep the active archive variable count below 500 per server when segments are daily; above that, switch to weekly segments and Storage Plus export.
  • Trend count per picture: maximum 8 trends per Online Trend Control, maximum 16 trends per picture. Split heavy screens into multiple pictures with navigation buttons.
  • Time range buttons: instead of loading the entire 5-year window (which can stall the control for seconds on cold cache), give operators 1 h / 1 d / 1 w / 1 mo / custom-range buttons. Initial load uses the operator-selected range, not the full archive.
  • Archive segment time alignment: align segment boundaries to off-shift hours (e.g., 00:00 local) so closures do not coincide with high activity.
  • Disk layout: keep the WinCC project, the swap directory, and the Storage Plus export target on separate physical volumes; share saturation is the single most common cause of archive stalls.
  • Cross-vendor comparison: AVEVA InTouch's Historical Trend control (AVEVA Documentation — Create a historical trend) uses an analogous swap-to-history model; if migrating between HMI platforms, replicate the same decimation pyramid to keep archive footprint comparable.

Troubleshooting Matrix

Symptom Likely Cause Diagnostic Fix
Trend control shows flat zero / no data Archive variable bound to wrong source, or Runtime not started Check Tag Logging editor → archive variable → Test button Re-bind variable; ensure Runtime is active
Data present for 2 days, then gaps Segment time exceeded; segment failed to close because disk full Check swap directory free space; WinCC Explorer → Computer → Properties → Startup Add disk, enable Storage Plus export, or decimate
Trend shows only live data, no history Time axis set to "live only" or online archive not configured Right-click control → Configuration → Time axis → Display historical data Enable historical display; set begin time to fixed range
Runtime startup slow (3+ minutes) Large segment count or slow disk Count *.lbf files in swap dir Reduce segment time to daily, enable Storage Plus daily export
Archive reset wipes everything ArchiveManager reset applied to wrong archive Verify archive name before reset Restore from Storage Plus export; redo configuration
5-year history not visible in trend Storage Plus not installed or path not reachable WinCC Explorer → Storage Plus → Test connection Install Storage Plus, configure path and credentials
CSV export truncated Operator selected too-wide range Check export parameters Limit operator export to visible window only
Alarm logging records corrupted Alarm Logging segment closed during write Check AlarmLogging for *.lbf with zero size Stop Runtime, run ArchiveManager reset on Alarm Logging only

Verification Checklist

  • [ ] Archive variable appears in Tag Logging editor with correct acquisition and archiving cycle.
  • [ ] Online Trend Control displays at least 24 h of historical data after 24 h of Runtime.
  • [ ] Swap directory ArchiveManager\TagLoggingSlow contains at least one closed segment with non-zero size.
  • [ ] Storage Plus export folder contains a matching closed segment after the configured export interval.
  • [ ] Disk free space > 30% of total volume.
  • [ ] Runtime restart completes within 90 s (single-server, <500 archive variables, daily segments).
  • [ ] Operator can scroll back to the oldest segment via the time-range buttons.
  • [ ] CSV export round-trips: the exported file opens in Excel with the expected timestamps and values.

Frequently Asked Questions

How do I configure an archive to retain data for 5 years in WinCC?

Local swap segments are practical only to roughly 6–12 months at typical tag counts. For 5-year retention, install SIMATIC WinCC/Storage Plus, configure the Storage Plus path in WinCC Explorer → Tag Logging → Storage Plus Configuration, and set the export to time- or size-controlled. Set retention of local copies to 14 days hot, with all older segments exported automatically. Reference: Siemens Support entry 29644083.

How do I calculate the segment size for a Tag Logging archive?

Use Samples_per_segment = (Segment_duration_seconds) / (Archiving_cycle_seconds) and Bytes_per_segment = Samples_per_segment × N_tags × 32 bytes. For 100 tags at 1 s archiving with 1-day segments, this yields ~264 MB per segment and ~94 GB per year. Multiply by years and add a 30% disk margin.

How do I reset WinCC Tag Logging archives?

Stop WinCC Runtime first. Open Start → SIMATIC → WinCC → Tools → ArchiveManager, select the project, then right-click each archive (TagLoggingFast, TagLoggingSlow, Alarm Logging) and choose Reset. ArchiveManager deletes the swap segments and rebuilds the headers safely. Restart Runtime to verify the trend begins at the current time.

Why does my trend control show only live data and no history?

The time axis is set to live-only mode. Open Configuration → Time axis in the Online Trend Control properties, switch to Display historical data, and define a begin time (either relative offset like now - 24 h or an absolute start). Without this, WinCC draws only the current acquisition window.

Can I store WinCC archives on a network share or NAS?

Yes, but assign the share to Storage Plus as the export target rather than pointing the live swap directory at it. Live swap on a slow share causes segment stalls and Runtime startup delays. For Storage Plus, use a UNC path (e.g., \\nas01\histdata) with a service account that has read/write permission, and verify the path with Storage Plus → Test connection.

Back to blog