Resolving OS Compilation Error 16003 - Compilation of Archive Tags Was Canceled in SIMATIC PCS 7

Resolving OS Compilation Error 16003 - Compilation of Archive Tags Was Canceled in SIMATIC PCS 7

In SIMATIC PCS 7 (v8.2 and v9.0), OS compilation aborting with 'Internal error: The compilation of archive tags was canceled. Error number: 16003' indicates a database inconsistency or duplicate tag conflict in WinCC Tag Logging. This occurs when identical archive tag names are compiled from merged AS projects, when deleted CFC blocks leave orphan archive records, or when Tag Logging runtime caches become corrupted. Resolving this requires identifying duplicate tags in the compilation log, resetting Tag Logging and Alarm Logging databases, executing a full AS compilation with module drivers, and running a full OS compile with memory reset.

Table of Contents

Mechanics of the AS-OS Compilation Archive Tag Phase

During an AS-OS Compilation in SIMATIC Manager:
1. Tag Compilation: The compiler extracts process variables marked with S7_m_c := 'true'.
2. Message Compilation: Translates Alarm_8P definitions into WinCC Alarm Logging.
3. Archive Tag Compilation:
The compiler evaluates block pins configured for historical archiving (e.g., analog process values tagged for Tag Logging Fast or Tag Logging Slow). It connects to the WinCC Tag Logging SQL database and updates archive tag tables.
* The Error 16003 Abort:
If the compiler attempts to insert an archive tag whose name or ID already exists, or if the Tag Logging SQL table rejects the schema update, compilation terminates immediately with Error number: 16003.

Root Causes of Error 16003 and Database Inconsistencies

  1. Duplicate Archive Tag Collision:
    When multi-user projects are merged or when an AS project is restored from an independent backup, two separate CFC charts may define identical archive tags (e.g., BAVN17403/1.FbkCloseOut#Value already exists).
  2. Orphan Archive Tags from Deleted Blocks:
    If an engineer deletes a CFC chart containing archived tags and performs a delta OS compile, WinCC retains the historical archive tag pointer while the source AS tag is gone, creating an orphan key violation.
  3. Tag Logging Runtime Cache Corruption:
    An unexpected power cut or hard termination of SIMATIC Manager during a previous compile can corrupt the local SQL Server Tag Logging database (<Project>.mdf).
  4. Group Display Hierarchy Failure:
    Often paired with warning ICCCSigGdo->ConstructCSigHierarchy error -2147467259, indicating that the Plant Hierarchy structure tags conflict with WinCC Picture Tree Manager.

Diagnostic Matrix: OS Compilation Error Codes and Underlying Causes

The table below outlines common AS-OS compilation error codes:

Error CodeLogged Error MessageUnderlying Root CauseCorrective Action16003Compilation of archive tags canceledDuplicate tag name or SQL constraint errorDelete duplicates; compile with memory reset302:3061Error occurred while updating archive tagsOrphan archive tags in Tag LoggingReset Tag Logging database-2147467259ConstructCSigHierarchy failedCorrupted Plant Hierarchy group displaysRe-run OS Project Editor16002Tag Management compilation errorInvalid symbol characters or naming collisionAudit tag names in Symbol Table

Analyzing the OS Compilation Log for Duplicate Tag Names

To pinpoint the exact tag causing the failure:
1. In SIMATIC Manager, select the OS object.
2. Click Options -> OS -> Compilation Log (or inspect Transfer.log in the OS project directory).
3. Search for the keyword already exists.
4. The log identifies the exact colliding tag string (e.g., BAVS17001/1.Ctrl#Value already exists), revealing the specific CFC chart and block requiring remediation.

Step-by-Step Procedure to Clear Error 16003 and Recompile the OS

  1. Audit and Rename Duplicate CFC Blocks:
    Open the CFC charts identified in the compilation log. Ensure all block instances and tag comments are globally unique across the multiproject.
  2. Execute Full AS Recompilation:
    * In SIMATIC Manager, select the AS chart folder.
    * Click Charts -> Compile -> Entire program. Ensure Generate module drivers is checked.
    * Click OK.
  3. Reset Tag Logging in WinCC Explorer:
    * Open WinCC Explorer on the Engineering Station.
    * Open Tag Logging.
    * Locate the problematic archive folder. If duplicate or corrupt archive tags exist, delete them manually.
    * Close Tag Logging and close WinCC Explorer.
  4. Execute Full OS Compilation with Memory Reset:
    * In SIMATIC Manager, right-click the OS Server object and select Compile.
    * In the OS compilation wizard, select Entire OS.
    * Check the box: With memory reset (this purges stale tag logging pointers and rebuilds the WinCC tag dictionary cleanly).
    * Complete the wizard. Compilation will finish with zero errors.
  5. Download to Target OS Servers:
    Perform a Target OS download to synchronize the rebuilt database with the plant runtime servers.

Verification

To verify that Error 16003 is resolved:
1. Check the OS Compilation summary dialog. Confirm that it displays 0 Errors, 0 Warnings.
2. Open WinCC Explorer -> Tag Logging. Confirm that all process value archives (Fast and Slow) populate with their respective tag members.
3. Open a WinCC process graphic containing trend curves. Verify that historical and online curves draw smoothly without broken communication status.

Limitations and Operational Precautions

  • Memory Reset Preserves Historical Logs: Compiling the OS "With memory reset" rebuilds configuration metadata; it does not delete historical trend archives stored on the hard drive or Process Historian.
  • Delta Download Lockout: Compiling the entire OS with memory reset requires a full download to the OS Server (or stopping runtime if changes cannot be loaded in delta mode). Plan execution during planned maintenance windows.
  • Licensing Disclaimer: SIMATIC PCS 7 OS engineering and runtime packages (6ES7658-2CX58-0YB5) must be validated against the applicable Siemens catalog and authorized distributor quotation.

Engineer FAQ

Technical References

Related Articles

Related Tags

  • OS Compilation
  • Error 16003
  • Archive Tags
  • Tag Logging
  • Memory Reset
  • Duplicate Tags
8 respuestas