Converting WinCC OS Projects to Reference Projects - Attaching Historical Alarm and Data Logs After Tag Renaming
When converting standalone OS1 and OS2 projects into WinCC Reference Projects of a master ES/OS project, old historical alarm and tag logging archives (*.mdf/*.ldf) cannot be automatically queried if tag names have been modified. In WinCC, Tag Logging archives index historical data by internal Archive Tag IDs rather than symbolic names. If tags are renamed in the master project, new internal IDs are created, causing trend curves bound to the new tags to show gaps for the historical period. To access old historical data, attach the archive segments via WinCC Archive Configuration -> 'Link archive...', and configure dedicated trend curves referencing the original tag names/IDs, or maintain tag name continuity during the conversion.
Table of Contents
- Architecture of WinCC Reference Projects vs Standalone Copied OS Stations
- Internal Archive Indexing: Tag Logging IDs vs Symbolic Tag Names
- Alarm Logging Continuity Across Reference Project Conversions
- Attaching Historical Archive Segments (.mdf / .ldf) in WinCC
- Comparative Impact Matrix: Project Restructuring and Archive Accessibility
- Step-by-Step Procedure to Link and View Historical Archives
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Architecture of WinCC Reference Projects vs Standalone Copied OS Stations
In SIMATIC PCS 7 and standalone WinCC environments, engineers configuring multiple identical operator stations frequently start by copying an initial ES/OS project to create OS1 and OS2. Over time, maintaining multiple independently edited projects becomes an engineering bottleneck.
To streamline maintenance, Siemens provides Reference Projects (or OS Single/Multiple stations referencing a master OS):
- Master Project (Base Project): The primary project where pictures (
*.pdl), scripts, tag management, and alarm logging are maintained. - Reference Project: An OS client or single-station configuration that references the master project's configuration files while maintaining its own local runtime database, local computer properties, and communication channel assignments.
When transitioning from independently running projects that have accumulated months of historical runtime archives to a unified Reference Project structure, preserving access to historical data requires understanding the underlying Microsoft SQL Server storage mechanics.
Internal Archive Indexing: Tag Logging IDs vs Symbolic Tag Names
The core engineering challenge when renaming tags during project restructuring lies in how WinCC Tag Logging indexes process values:
-
Internal Archive Tag IDs: WinCC SQL databases do not store raw tag names (e.g.,
Reactor1/TIC101.PV_Out#Value) alongside every recorded floating-point sample. Doing so would consume massive storage. Instead, WinCC assigns each archive tag a unique integer Archive Tag ID. -
Tag Renaming Behavior: When a tag is renamed or deleted and recreated in the master project, the Tag Logging subsystem assigns a new Archive Tag ID. The historical database segments (
*.mdffiles) contain records indexed under the old Tag ID. -
Trend Control Disconnection: In Runtime, when a WinCC Online Trend Control requests historical values for the renamed tag, it queries the database using the new Tag ID. Consequently, no data points are returned for the period preceding the rename, creating a visible gap in the historical trend.
Alarm Logging Continuity Across Reference Project Conversions
Unlike process value trends, Alarm Logging exhibits different continuity characteristics:
-
Message Number Indexing: WinCC Alarm Logging records historical events indexed by their unique integer Message Number (MsgNumber).
-
In PCS 7, message numbers are automatically assigned by Step 7 during AS-OS compilation based on the
ALARM_8Pblock instance IDs. -
If the block instances in CFC remain unchanged and only graphic faceplates or non-alarm tags were renamed, the Message Numbers in the new reference project will match the Message Numbers in the old archive files.
-
Under this condition, attaching old Alarm Logging segments allows the WinCC AlarmControl Long-Term Archive List to display historical alarms seamlessly.
Attaching Historical Archive Segments (.mdf / .ldf) in WinCC
WinCC provides a standardized mechanism to link detached historical database segments:
-
Archive Configuration: In WinCC Explorer, expanding Alarm Logging or Tag Logging provides access to Archive Configuration.
-
Linking Archives: By right-clicking the archive folder and selecting Link archive..., an engineer can select historical
*.mdffiles located in local backup directories or network shares. -
Dynamic SQL Attachment: WinCC dynamically executes SQL commands to attach the database segments into the active SQL Server instance, making their historical tables queryable by runtime controls without modifying the active project's current logging segment.
Comparative Impact Matrix: Project Restructuring and Archive Accessibility
The following table summarizes the behavior of WinCC historical data across project conversion and tag modification scenarios:
TagLoggingFast/SlowAlarmLogStep-by-Step Procedure to Link and View Historical Archives
Follow this procedure to link and access historical archives in the restructured reference project:
-
Safeguard Existing Databases:
- Before making any project changes, deactivate WinCC Runtime on OS1 and OS2.
- Back up all*.mdfand*.ldffiles from the project directory underArchiveManager\AlarmLogging\andArchiveManager\TagLoggingFast/Slow\. -
Implement Reference Project Architecture:
- In SIMATIC Manager, configure OS1 and OS2 as reference projects of the master ES/OS.
- Download the new project structure to the target operator stations. -
Link Historical Segments in WinCC Explorer:
- On OS1/OS2, open WinCC Explorer and expand Tag Logging (or Alarm Logging).
- Expand Archive Configuration > Fast / Slow Tag Logging.
- Right-click and select Link archive...
- Browse to the backup folder and select the historical*.mdffiles.
- WinCC attaches the segments to the active Microsoft SQL Server instance. -
Configure Trend Views for Renamed Tags:
- In Graphics Designer, open the process graphic hosting the historical trend control.
- Add a secondary curve referencing the historical archive tag name or old Tag ID for the historical time range.
- Save the picture and verify seamless visualization across past and present data.
Verification
Validate historical archive accessibility through these verification steps:
- Activate WinCC Runtime on the reference station.
- Open the WinCC AlarmControl and switch the view to Long-Term Archive List.
- Set the time filter to a date range covering the old project execution period. Confirm that historical alarms are clearly displayed.
- Open the WinCC Online Trend Control. Query the historical date range for un-renamed tags and verify that continuous trend lines appear.
- For renamed tags, verify that the secondary trend curve successfully extracts and renders the old data points.
Limitations and Operational Precautions
- Maximum 200 Single Segments Limit: Attaching too many historical archive segments can degrade SQL Server performance. Ensure that the total count of attached segments does not exceed the manufacturer limit of 200 single segments.
- SQL Server Version Lock: Archive files created under older SQL Server releases (e.g., SQL Server 2008) cannot always be attached to newer SQL Server instances (e.g., SQL Server 2014 or 2016) without database upgrade procedures.
- Centralized Archiving Recommendation: For long-term historical records spanning multiple years and project redesigns, deploy SIMATIC Process Historian (PH), which decouples long-term archiving completely from local OS project lifecycles.
Engineer FAQ
Can I copy archive files directly into the active ArchiveManager directory?
Yes. If you copy *.mdf and *.ldf files into the CommonArchiving folder or the active ArchiveManager folder, WinCC can automatically detect and mount them if the naming convention matches the active project prefix.
What happens to historical data if I change the archive segment size?
Changing segment size only affects future archive segments generated by the system. Existing closed segments remain intact with their original size and data density.
Why does WinCC Trend Control show a flat line after renaming a tag?
A flat line or gap indicates that the trend curve is querying an Archive Tag ID that has no recorded values for that timestamp range in the database segments.
Can I rename a tag directly inside the SQL database tables?
No. Manually editing WinCC SQL database tables directly via SQL Server Management Studio is strictly prohibited by Siemens and can cause fatal database corruption and project failure.
How do I detach a linked archive when I no longer need it?
In WinCC Explorer, expand Archive Configuration -> right-click the linked archive segment -> select Remove archive link.
Technical References
- WinCC V7.4 / V7.5 System Manual: Working with WinCC - Archiving Process Values and Alarms
- Siemens Industry Online Support (SIOS) Entry ID 180760 - Make OS1, OS2 project as ref project of ESOS project
- SIMATIC Process Control System PCS 7 OS Process Control Manual - Section 9: Archiving Mechanics
- SIMATIC Process Historian Administration and Configuration Manual
Related Articles
- Configuring Database Segment Sizes in WinCC and PCS 7 - The 200 Single Segment Rule
- Resolving Empty WinCC Event Lists and SQL Transaction Log Ballooning in SIMATIC PCS 7
- Integrating Third-Party and OEM WinCC Projects into SIMATIC PCS 7 OS
- Cross-Multiproject OS Client Architecture in SIMATIC PCS 7
Related Tags
- Tag Logging
- Alarm Logging
- WinCC Archives
- Reference Projects
- SQL Server
- CommonArchiving
- PCS 7 OS