Resolving Generic OS Compilation Failures 'Error occurred compiling the object' in SIMATIC PCS 7
In SIMATIC PCS 7, the generic compilation failure 'Error occurred compiling the object. Refer to the log for the single objects for more information' indicates that the WinCC OS Compiler coordinator (CCExpOp.exe / s7opasbx.dll) encountered an unhandled exception in an underlying sub-module. To resolve this error, engineers must inspect the detailed single-object log files (transfer.log and compile.log in the OS project directory or via SIMATIC Manager 'Options > Logs > Compile...'). The root causes typically stem from missing or uncompiled S7 Named Connections in NetPro, Microsoft SQL Server database lockups, invalid Windows user group memberships (specifically SIMATIC HMI and SQLServer groups), or corrupted template block icons in @PCS7Typicals_APL.pdl.
Table of Contents
- Architecture of the WinCC OS Compilation Process
- Locating and Interpreting Single Object Compilation Logs
- Common Root Causes and Technical Remediation
- OS Compilation Diagnostic and Resolution Matrix
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Architecture of the WinCC OS Compilation Process
In SIMATIC PCS 7, the OS Compilation (WinCC OS Compile) is the critical automated bridge linking the Automation Station (AS) engineering database to the Operator Station (OS) visualization database.
During an OS compile, the engineering system processes all CFC and SFC charts, extracting function blocks possessing the system attribute s7_m_c = 'true'. The compilation subsystem coordinates multiple internal tasks:
1. Communication Channel Generation: Establishes tag connections under the WinCC SIMATIC S7 Protocol Suite > Named Connections channel based on NetPro routing tables.
2. Tag Structure Generation: Creates structured tag instances in the WinCC Microsoft SQL Server database matching AS block interfaces (.PV_Out, .EventState, .SP_Ext).
3. Alarm Logging Population: Imports ALARM_8P message definitions, assigning unique message IDs, event texts, and message classes.
4. Archive Tag Configuration: Configures fast and slow historical archiving for variables marked with the archiving attribute.
5. Block Icon Instantiation: Scans process pictures and automatically inserts or updates graphical block icons from template pictures (@PCS7Typicals_APL.pdl).
If any single sub-task fails, the master compilation coordinator halts with the generic abort message: Error occurred compiling the object.
Locating and Interpreting Single Object Compilation Logs
When the generic error appears in the OS Compilation Wizard, restarting SIMATIC Manager or re-running the compile blindly will not fix the issue. Engineers must consult the single object logs:
Method 1: Viewing Logs Inside SIMATIC Manager
- In SIMATIC Manager, select the OS station object in the component view.
- Select menu Options > Logs > Compile....
- In the Compilation Log dialog, expand the log tree under the failed OS station.
- Select the individual sub-logs:
- AS-OS Connection: Reports NetPro S7 connection errors.
- Tags: Reports database insertion failures and duplicate tag errors.
- Messages: ReportsALARM_8Pmetadata translation errors.
- Picture Tree / Block Icons: Reports Graphics Designer template corruption.
Method 2: Inspecting Raw Log Files on Disk
Navigate directly to the OS project folder on the Engineering Station:
$$\text{\\wincproj\}$$
Open the following diagnostic text files:
- transfer.log: Records real-time communication between STEP 7 and the WinCC database.
- compile.log: Details internal SQL Server transactions and syntax exceptions.
- Look for error signatures such as:
- Database error: Cannot open database requested by the login
- Error in function S7_Connection_Check: Connection not configured
- Object @MonAnL/1: Custom object structure mismatch
Common Root Causes and Technical Remediation
Based on the log findings, implement the targeted technical remediation:
Cause 1: Missing or Uncompiled S7 Named Connection in NetPro
If transfer.log reports Connection not configured or Named Connection missing:
1. Open NetPro in SIMATIC Manager.
2. Verify that an S7 connection exists between the AS CPU and the WinCC Application inside the PC Station.
3. Select menu Network > Save and Compile.... Choose Compile and check everything.
4. Once NetPro compiles cleanly, restart the OS compile.
Cause 2: Microsoft SQL Server Lockup or Database Corruption
If logs report SQL connection timeouts or database write errors:
1. Close SIMATIC Manager and WinCC Explorer.
2. Open Windows Command Prompt as Administrator.
3. Run the Siemens WinCC database reset utility:
cmd
cd "C:\Program Files (x86)\Siemens\WinCC\bin"
reset_wincc.vbs
4. If the database remains inaccessible, launch the WinCC Project Duplicator to create a clean, defragmented copy of the OS project.
Cause 3: Insufficient Windows Security Group Memberships
If compilation fails during database initialization:
1. Open Windows Computer Management (compmgmt.msc) > Local Users and Groups > Groups.
2. Verify that the logged-in Windows user account is an active member of:
- SIMATIC HMI
- SIMATIC NET
- SQLServer2008 (or SQLServer2014 / SQLServer2016 depending on PCS 7 release)
3. If memberships were added, log off and log back in for changes to take effect.
Cause 4: Corrupted Template Picture (@PCS7Typicals)
If compilation aborts during the 'Create/update block icons' phase:
1. Open @PCS7Typicals_APL.pdl in Graphics Designer.
2. Check for damaged customized objects or ungrouped templates.
3. If necessary, restore the default @PCS7Typicals_APL.pdl from the standard Siemens library directory (C:\Program Files (x86)\Siemens\Step7\s7libs\...).
OS Compilation Diagnostic and Resolution Matrix
The following matrix maps log error signatures to definitive technical solutions:
S7_Connection_Check: Named connection failedCannot open database requested by the loginreset_wincc.vbs from WinCC\bin; verify Windows SQL security groupsUser not in group SIMATIC HMISIMATIC HMI and SQLServer groups; reboot PCError updating block icon: Object corrupted@PCS7Typicals_APL.pdl from library; check tagname propertyTag name exceeds 128 charactersVerification
To confirm that the OS compilation process is fully resolved:
1. In SIMATIC Manager, right-click the OS project and select Compile.
2. Select Entire OS (or Changes only if structural repair is complete).
3. Ensure checkboxes for Tags and screen objects and Create/update block icons are selected.
4. Execute the compilation: The wizard must run through all phases (DB transfer, message compilation, block icon generation) and finish with 0 Errors.
5. Open the compilation log via Options > Logs > Compile... and verify that all single object sub-logs report successful completion.
Limitations and Operational Precautions
Observe the following engineering constraints:
- Do Not Compile OS While WinCC Runtime is Active: Never initiate an OS compile while WinCC Runtime is running on the Engineering Station unless executing an approved Changes-only online download. Compiling entire objects while runtime has database locks will crash the compile engine.
- Tag Limits and Process Objects (PO): Verify that the compiled tag count does not exceed your installed AS RT and OS RT Process Object license entitlements in Automation License Manager.
- SQL Server Antivirus Exclusions: Ensure that third-party antivirus software excludes the WinCC project directories (*.mdf, *.ldf) from real-time file scanning, as file locking by antivirus scanners is a frequent cause of compilation crashes.
Engineer FAQ
Where do I find the single object log files for the OS compile?
In SIMATIC Manager, select the OS station and choose Options > Logs > Compile... Alternatively, open the OS project folder on disk and inspect transfer.log and compile.log in the wincproj directory.
Why does running reset_wincc.vbs fix the compile error?
reset_wincc.vbs terminates lingering background WinCC processes (such as CCExpOp.exe, CCAlgRtServer.exe) and releases hanging locks on the Microsoft SQL Server database, allowing the compiler to obtain exclusive access.
What does an S7 Named Connection error mean during OS compile?
It means the OS compiler could not locate a valid communication route between the S7-400 CPU and the WinCC Application in NetPro. Saving and compiling NetPro with 'Compile and check everything' restores the required routing tables.
Technical References
- SIMATIC Process Control System PCS 7 Operator Station Engineering (A5E36988894-AA)
- SIMATIC HMI WinCC V7.4 WinCC Information System - System Overview (A5E37536400-AA)
- SIMATIC Process Control System PCS 7 Compendium Part A - Configuration Guidelines (A5E43573954-AB)
Related Articles
- Resolving WinCC OS Compilation Error 1739 Invalid Object Type During Changes Compile
- Resolving Automatic Block Icon Tag Name Generation Failures in SIMATIC PCS 7
- Troubleshooting S7 Named Connection Interruption Across Distributed PCS 7 OS Stations
- Recovering Missing License Keys and Automation License Manager Database Corruption
Related Tags
- OS Compilation
- WinCC
- SIMATIC PCS 7
- SQL Server
- NetPro
- Troubleshooting
- Engineering System