Resolving WinCC API Error 4029 (PutSingleMessageProperties) During OS Compilation

Resolving WinCC API Error 4029 (PutSingleMessageProperties) During OS Compilation

WinCC API Error 4029 ('Message was not created: PutSingleMessageProperties... Ret=-1 Err1=0x80004005') during AS-OS compilation in SIMATIC PCS 7 V8.1 SP1 indicates a database failure when writing message records into the WinCC Alarm Logging SQL tables. The error code 0x80004005 (E_FAIL) points to corrupted Alarm Logging indexes, locked SQL database tables, duplicate message number collisions, or a known message compiler bug present in WinCC V7.3 Upd4. To resolve this, execute CCResetProject.exe to clear locks, rebuild the message database using an 'Entire OS with memory reset' compile, and install WinCC V7.3 SE Upd5 or higher.

Table of Contents

AS-OS Message Compilation Mechanism and the WinCC API

During AS-OS engineering compilation in SIMATIC PCS 7, the compilation engine synchronizes alarm configurations defined in CFC chart blocks (such as ALARM_8P instances within APL blocks MotL, VlvL, and MonAnL) into the WinCC Alarm Logging subsystem. The compiler communicates with the WinCC SQL database using internal ODK API calls, specifically PutSingleMessageProperties.

Each message contains attributes such as Message Number, Message Class, Message Type, Event Text, and process value archive assignments. If the database engine encounters an unhandled exception while inserting or updating a message record, the API aborts the transaction and logs Error number: 4029 alongside COM HRESULT error 0x80004005 (Unspecified Error).

Root Cause Analysis - Database Locks and Error 0x80004005

Three technical conditions typically trigger WinCC API Error 4029 during compilation:
1. Software Defect in WinCC V7.3 Upd4: In PCS 7 V8.1 SP1 systems running WinCC V7.3 Upd4, a specific defect in the Alarm Logging compilation binary causes memory leaks and index corruption when compiling projects with large message counts. Siemens resolved this issue in WinCC V7.3 SE Upd5 and PCS 7 V8.1 SP1 Update Collection 2 (UC2).
2. Orphaned SQL Server Locks or Background Services: If WinCC Runtime was improperly terminated, or background processes (CCConfigStudio.exe, CCDataServer.exe) retained open locks on the project database file (*RT.mdf), SQL Server blocks write transactions.
3. Duplicate Message Number Assignment: If blocks were copied across projects or manually assigned duplicate message numbers in STEP 7, the unique constraint index on the message table is violated.

Diagnostic Matrix for WinCC API and Message Compilation Errors

The table below details error codes, diagnostic logs, and root cause classifications for AS-OS compilation faults:

Error Code / IndicatorDiagnostic MessagePrimary CauseResolution ActionError 4029PutSingleMessageProperties: PutCollectID... Ret=-1SQL insert failure in Alarm Logging table.Reset WinCC project locks; execute Entire OS compile.0x80004005E_FAIL (Unspecified failure)Database index corruption or lock timeout.Execute CCResetProject.exe and check SQL disk space.Duplicate Msg IDMessage number already exists in databaseConflicting ALARM_8P block message IDs.Run Options -> Assign Message Numbers in STEP 7.WinCC V7.3 Upd4Crash during compilation of large projectsKnown compiler memory corruption defect.Update to WinCC V7.3 Upd5 / Upd6 or PCS 7 V8.1 SP1 UC2.Transfer.logLocated in <Project_Folder>\GlobalRecords step-by-step compiler transactions.Inspect for the exact block name that failed insertion.

Step-by-Step Resolution and Database Recovery Procedure

  1. Terminate WinCC and Reset Locks:
    - Close SIMATIC Manager and all WinCC Explorer windows.
    - Open the command prompt as Administrator and execute: "C:\Program Files (x86)\Siemens\WinCC\bin\CCResetProject.exe".
    - Wait for the reset utility to release all open database handles and terminate lingering WinCC background processes.
  2. Check for Duplicate Message Numbers in STEP 7:
    - In SIMATIC Manager, select the AS project object -> select Options -> Assign Message Numbers....
    - Verify that all blocks possess unique, globally valid message numbers.
  3. Apply Software Updates: Verify WinCC version in WinCC Explorer (Help -> About). If running WinCC V7.3 Upd4, install WinCC V7.3 Upd5 (or latest Update Collection for PCS 7 V8.1 SP1).
  4. Recompile OS with Memory Reset:
    - In SIMATIC Manager, right-click the OS Server object and select Compile.
    - In the compilation wizard, select Entire OS and explicitly check With memory reset.
    - Run compilation: the compiler completely purges obsolete message tables and regenerates all message indexes cleanly.
  5. Verify Compilation Log: Open the compilation log: confirm zero errors and successful completion of the message transfer phase.

Verification

Verify resolution through the following milestones:
1. Confirm that the AS-OS compilation finishes with status 0 Errors, 0 Warnings (or benign informational notices).
2. Open WinCC Explorer on the OS Server, launch Alarm Logging, and verify that the message list displays all process messages with correct block names, message classes, and event texts.
3. Start WinCC Runtime and trigger a test alarm: verify immediate display in the Alarm Control without database write errors.

Limitations and Operational Precautions

Never execute CCResetProject.exe while WinCC Runtime is active on a live production station, as it forcibly drops database connections and terminates communication channels. Always perform database resets during scheduled maintenance windows or on engineering stations. Furthermore, never attempt to manually delete SQL tables or edit schema files inside the WinCC SQL instance directly.

Engineer FAQ

Technical References

Related Articles

Related Tags

  • Error 4029
  • OS Compilation
  • Alarm Logging
  • PutSingleMessageProperties
  • WinCC V7.3
  • CCResetProject
6 respuestas