Restoring Local WinCC Trends After PCS7 SSM Server Migration

David Krause14 min read
SiemensTroubleshootingWinCC
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

Problem Overview: Trends Vanish After Enabling Centralized Server Storage

After switching a Siemens PCS 7 multi-project to server-centralized trend storage via the SSM server setting in WinCC Explorer, operators frequently find that previously configured client-local trends no longer appear in the runtime pictures. The trend configuration files remain on disk under \\<client>_pcs7_project\TRG\, but the runtime clients now resolve their trend list exclusively from \\<server>_pcs7_project\TRG\. Simply copying the client TRG folder contents into the server TRG folder is not sufficient because each *.trg file carries a binding Location property that controls whether the trend is sourced locally, remotely, or only from one of the two locations.

The visible symptoms are:

  • Trend controls in WinCC Runtime show empty plot areas, "no data" messages, or red broken-icon indicators.
  • Trend configuration dialogs in WinCC Explorer (graphics designer) display no items in the trend list on the affected clients.
  • Server-side trends continue to display normally; only client-local trends are affected.
  • Trend files copied to the server TRG directory are present on disk but ignored by the WinCC trend loader.
  • Diagnostics window (Ctrl+Alt+D in Runtime) reports Trend group not found or Invalid Location property for every missing trend.

This article documents the root cause, the file-level fix, the verification procedure, and the field-proven prevention measures for the SSM-centralized trend recovery scenario.

PCS 7 Multi-Project Trend Architecture

A PCS 7 multi-project separates the engineering project and the runtime project for every OS server and OS client. Each station keeps its own WinCC project subtree under the SIMATIC Manager multi-project root. The trend-related subfolders in a typical WinCC project look like this:

Folder Contents Phase
<project>\GraCS\ PDL pictures, C scripts, VB scripts, faceplates Engineering + Runtime
<project>\TRG\ Trend group configuration files (*.trg) Engineering + Runtime
<project>\ARC\ Tag Logging archive configuration Engineering + Runtime
<project>\Library\ Project library objects Engineering
<project>\RT\ Runtime-only generated files Runtime
<project>\PAS\ Process tag database Engineering

The TRG folder stores trend group definitions in plain-text *.trg files. Each file describes a single trend group that can be referenced from a WinCC picture. The trend group contains the trend windows, the trend tags (typically referenced as @<ArchiveName>::<TagName>), the time axis, value axis, and the curve formatting parameters.

In a multi-client system there are normally two ways a trend group can be served at runtime:

  1. Local trend (client-resident): The trend group is part of the client's WinCC project. The runtime client renders and archives the trend data locally.
  2. Server-shared trend: The trend group lives on a designated OS server. All clients referencing this trend group receive the trend data from the server's archive.

The SSM server setting selects one of these modes per client. Once the setting is changed to "Server 1" for all clients, the clients no longer evaluate the local TRG folder when assembling the trend group list at Runtime startup.

Root Cause: The Location Property in *.trg Files

Every *.trg file carries a header section containing a Location attribute. This attribute determines how the WinCC trend loader interprets the file at runtime. Two values are in active use:

Location Value Meaning Runtime Behavior
1 Trend is local to the station hosting the file Only loaded by the local station; ignored when a remote/server-shared resolution path is configured
2 Trend is sourced from a remote OS server Only loaded when the station references a remote trend server (SSM); ignored if the station runs in local-only mode

There is no documented third value that allows the trend to load under both local and remote modes. This means a single *.trg file is bound to exactly one resolution path. A copy operation between stations does not change the Location attribute; the file remains marked with its original mode and continues to be filtered out by the trend loader on the destination station.

When the SSM setting is changed from "client-local" to a server designation, the previously configured local trends (Location = 1) are correctly identified by the loader as local-only and are filtered out of the remote-served list. Field reports show that on some PCS 7 service packs the loader performs a self-healing pass after the SSM change and rewrites the Location property to 2 for any trend that was successfully promoted to the server. A backup snapshot of an affected project showed Location=1 in the pre-migration state, and the same file on the server carried Location=2 after the SSM migration with the trend now appearing as expected on the clients.

Pre-Recovery: Snapshot the Existing Configuration

Before editing any *.trg file, capture a backup of the entire multi-project. This guarantees a roll-back path if a file is corrupted by manual editing.

  1. Close WinCC Explorer and stop the WinCC Runtime on every client and server.
  2. Copy the full <multiproject>\<station>_pcs7_project\ directory tree to a dated backup folder (for example D:\Backup\PCS7_<timestamp>\).
  3. Export the WinCC project using the SIMATIC Manager Project > Archive function. Reference the Siemens Industry Online Support portal for the export procedure specific to your PCS 7 version (V8.x, V9.0, V9.1, V10.0).
  4. Record the SSM target server assignment from WinCC Explorer > Computer properties for every client so you can re-apply it if a roll-back is required.
  5. Capture a directory listing of every *.trg file on every station with dir /s *.trg > trg_inventory.txt. The list becomes the migration manifest.
Safety: Never edit *.trg files while WinCC Runtime is running. The trend loader caches the file list in memory and will overwrite your manual edits on shutdown.

Step-by-Step Recovery Procedure

The recovery procedure rewrites the Location attribute of every promoted *.trg file from 1 (local) to 2 (server-shared) so the WinCC trend loader treats the file as a valid remote trend after SSM centralization.

  1. Confirm the SSM target. On every OS client, open WinCC Explorer, right-click Computer, select Properties, and verify the trend server selection under Graphics Runtime > Trends is set to the desired OS server (for example Server 1).
  2. List the candidate files. On the SSM server, open a command prompt and run dir \\<server>_pcs7_project\TRG\*.trg /b to enumerate every trend group file currently served.
  3. Identify trends that need promotion. Compare the list above with the list of trends previously configured locally on each client. Any trend missing from the server list is a candidate for promotion.
  4. Copy the candidate files to the server TRG folder. Use robocopy "\\<client>_pcs7_project\TRG" "\\<server>_pcs7_project\TRG" *.trg for each affected client. Do not overwrite files that already exist with the same name unless you intend to replace the server trend with the client version.
  5. Inspect a file with Notepad. Open one of the copied *.trg files in Notepad. The header section contains a line similar to [TrendGroup] followed by Location=1 or Location=2.
  6. Edit the Location property. Change Location=1 to Location=2 for every trend you want to be available to clients via the server. Save the file with UTF-8 encoding (Notepad's default in current Windows builds).
  7. Bulk-rewrite with a script. For multi-client rollouts, automate step 6 with a PowerShell one-liner:
    Get-ChildItem "\\<server>_pcs7_project\TRG\*.trg" | ForEach-Object {
        (Get-Content $_.FullName) -replace '^Location=1$','Location=2' | Set-Content -Encoding UTF8 $_.FullName
    }
    The regex anchors both ends of the line to avoid replacing partial matches such as Location=10.
  8. Verify line endings. Re-open one of the rewritten files in Notepad. The file should display Location=2 with no leading whitespace and no trailing characters.
  9. Re-deploy the project. On the OS server, run WinCC Explorer > Computer > Properties > Trends > Update or trigger a full OS project compile to refresh the trend loader cache.
  10. Restart Runtime. Start the WinCC Runtime on the server first, wait for the trend loader to complete initialization, then start Runtime on each client.

Verification Protocol

After the recovery procedure, validate the trend group visibility on every client:

  1. Open the affected WinCC picture in Runtime on a client station.
  2. Right-click the trend control and select Configuration > Trend Selection.
  3. Confirm that the promoted trend group now appears in the trend list.
  4. Switch the time base (1 hour, 8 hours, 24 hours) and verify that archived values are displayed.
  5. Check the WinCC diagnostics window (Ctrl+Alt+D) for any trend loader error entries such as Trend group <name> not found or Invalid Location property.
  6. Open the server-side *.trg file in Notepad again and verify the Location property is exactly Location=2 with no trailing whitespace.
  7. Check the file's encoding by opening it in Notepad > Save As; the encoding must remain UTF-8 (not UTF-16 or ANSI).
  8. Confirm the file is not write-protected; a read-only attribute will silently cause Set-Content to fail.

SSM Server Configuration Reference

The following table captures the property values referenced by WinCC Explorer when configuring SSM (server-shared trend) routing on a client.

Property Path in WinCC Explorer Valid Values Notes
Trend source Computer > Properties > Graphics Runtime > Trends Local / Server 1 / Server 2 / ... Selects the OS server that hosts the trend groups
Alarm source Computer > Properties > Graphics Runtime > Alarms Local / Server n Independent of trend source
Archive source Tag Logging > Archives > Properties Local / Server n Determines where the archive data is read from
Location attribute in *.trg Header of the *.trg file 1 = local, 2 = remote Must match the trend source of the station
Redundancy partner Computer > Properties > Redundancy None / Server n Independent of trend source

The Siemens PCS 7 documentation set on the Siemens Industry Online Support portal contains the full reference for the trend loader, including the file format specification and the supported attribute values per PCS 7 version.

Edge Cases and Field-Proven Caveats

  • Self-healing rewrite: On some PCS 7 service packs the trend loader rewrites Location from 1 to 2 automatically when a file with Location=1 is detected in the server TRG folder. If the loader has already self-healed, manual editing is unnecessary and re-running the bulk-rewrite script is safe (idempotent).
  • Encoding drift: Files originally authored in WinCC Explorer are typically saved as ANSI or UTF-8 without BOM. Editing them in Notepad on a German Windows build can silently convert them to UTF-16, which the trend loader rejects. Always save in UTF-8 (Notepad > Save As > Encoding > UTF-8).
  • Read-only attribute: If the *.trg file is marked read-only (common after a project archive), Set-Content or Notepad save will silently fail. Clear the read-only attribute with attrib -R *.trg before editing.
  • Concurrent editing: Do not edit the server TRG folder while WinCC Runtime is running on the server. The trend loader caches the file list and will overwrite the edits on the next save cycle.
  • Trend group naming collisions: If two clients have a trend group with the same file name but different configurations, the server copy wins. Resolve conflicts by renaming the file (and the trend group reference inside the PDL) before merging.
  • Redundant projects: PCS 7 multi-projects frequently contain redundant OS projects that are not currently used. Do not delete or edit files in those projects; they are kept as fall-back stations for redundancy servers.
  • WinCC version differences: The trend file mechanism described here applies broadly across PCS 7 V8.x, V9.0, V9.1, and V10.0. The Siemens PCS 7 product page documents the per-version changes to the trend loader and the SSM routing model.
  • Picture references: After promoting a trend, verify that the trend picture still references the correct trend group name. A renamed trend group will leave dangling references in PDL files that WinCC logs as warnings.

Troubleshooting Matrix

Symptom Likely Cause Verification Remediation
Trend list is empty on client SSM target points to a server that does not host the trend Check Computer > Properties > Trends Re-point to the correct server
Trend file present on server but not displayed Location attribute still = 1 Inspect *.trg header Change Location to 2
Trend loads but shows no archived data Archive source not aligned with trend source Check Tag Logging archive properties Re-point archive to the same server
"Invalid Location property" in diagnostics Location value outside {1,2} Inspect *.trg header Set Location to 2
Edits are reverted at Runtime restart Trend loader overwrote the file Diff the file before/after Runtime start Stop Runtime, re-apply edits, restart
Trend visible on server, missing on client Client's SSM points to a different server Check Computer > Properties on client Re-point the client to the same server
Trend file opens as binary garbage File is UTF-16 or corrupted Open in Notepad, check encoding Re-save as UTF-8
Bulk script reports zero changes All files already carry Location=2 Inspect *.trg headers No action needed; trend loader has already self-healed
Trend appears but values are flatlined Archive tags not connected to PLC Check Tag Logging connection status Re-establish the AS-OS connection

Prevention: Trend Configuration Best Practices

The Location attribute mismatch is a classic post-migration issue. The following practices prevent recurrence:

  • Author trends on the SSM server first. Even when you intend a trend to be client-local, design the trend group on the OS server and replicate it to clients. The Location attribute is then already 2 and the file is portable across both modes.
  • Use a single source of truth. Maintain a master TRG folder on a file server and use robocopy /MIR to distribute it to every station. This keeps the file list identical and removes the Location ambiguity.
  • Version the TRG folder. Add the trend group files to the multi-project's version control system (Subversion, Git, or TIA Project Server if your PCS 7 version supports it). Each commit captures the Location attribute and any trend group redefinition.
  • Document the SSM topology. Maintain a network diagram showing which client references which OS server for trends, alarms, and archives. Distribute the diagram with the project archive so that future migrations start with a known baseline.
  • Validate after every SSM change. After any change to the trend source selection, run a runtime validation sweep on every client: open the trend picture, verify the trend list, and check the diagnostics window for Trend group not found entries.
  • Lock the TRG folder at runtime. Configure NTFS permissions so that only the WinCC service account can write to the TRG folder at runtime. This prevents accidental edits from corrupting the file list.

Multi-Client Rollout: Bulk Promotion Procedure

For plants with more than ten OS clients the manual edit step becomes impractical. Use this PowerShell procedure to promote every *.trg file in the source TRG folder to Location=2 in one pass:

$source = '\\client01_pcs7_project\TRG'
$target = '\\server01_pcs7_project\TRG'

# Copy any *.trg that does not exist on the server
robocopy $source $target *.trg /XO /R:3 /W:5

# Promote all newly copied files to Location=2 (server-shared)
Get-ChildItem "$target\*.trg" | Where-Object {
    (Select-String -Path $_.FullName -Pattern '^Location=1$' -Quiet)
} | ForEach-Object {
    Write-Host "Promoting $($_.Name)"
    (Get-Content $_.FullName -Encoding UTF8) -replace '^Location=1$','Location=2' |
        Set-Content -Encoding UTF8 $_.FullName
}

Run the script with WinCC Runtime stopped on the server. After completion, perform the verification protocol on at least one representative client per OS server. Capture the script output to a log file (Start-Transcript -Path C:\Logs\trg_promotion.txt) for audit trail purposes.

Standards and Reference Documentation

The PCS 7 trend loader is documented in the WinCC Information System installed with every PCS 7 engineering station, and the per-version manuals are mirrored on the Siemens Industry Online Support portal under the PCS 7 product tree. Reference the specific PCS 7 version's WinCC Information System for the canonical attribute list and the supported Location values. Process-control trend retention intervals are governed by plant-specific standards (such as ISA 18.2 for alarm management and IEC 62443 for network segmentation); verify with your plant's engineering standards before changing archive retention windows.

What does the SSM server setting control in PCS 7 WinCC?

The SSM server setting on an OS client selects the OS server that supplies the trend groups, alarm routing, and archived tag data. It is configured in WinCC Explorer under Computer > Properties > Graphics Runtime > Trends and is independent of the alarm and archive source selections on the same property page.

What does the Location property in a *.trg file mean?

Location is a header attribute in the WinCC trend group file that declares the resolution path of the trend. A value of 1 means the trend is local to the station hosting the file; a value of 2 means the trend is sourced from a remote OS server. The trend loader filters the trend list by this attribute at Runtime startup.

Can a single *.trg file be served both locally and from the server?

No. The Location attribute is binary. A file marked Location=1 is only visible to the local station; a file marked Location=2 is only visible when a remote server is selected. To support both modes, keep two copies of the file (one per Location value) on the appropriate stations and author the trend group references accordingly.

Do I need to restart WinCC Runtime after editing *.trg files?

Yes. The trend loader caches the file list and the Location attribute in memory. Runtime must be restarted (preferably on the OS server first, then on each client) for the edits to take effect. Edits made while Runtime is running are typically overwritten on shutdown because the loader flushes its cache back to disk.

How can I prevent the Location mismatch from recurring?

Author trends on the OS server first so the Location attribute is already 2, distribute the TRG folder from a single source via robocopy /MIR, version the trend group files in source control, lock the TRG folder at runtime to the WinCC service account, and validate every client after any SSM topology change.

Why does copying the TRG folder from client to server not work on its own?

Copying the *.trg files places them on the server disk, but the Location attribute inside each file still reads 1 (local-only). The WinCC trend loader on the server filters those files out when assembling the remote-served trend list. The file content must be edited so Location reads 2 before the loader accepts the trend as server-shared.

Back to blog