Clearing WinCC .LCK File Locks and Resolving Target OS Download Blockages in SIMATIC PCS 7

Clearing WinCC .LCK File Locks and Resolving Target OS Download Blockages in SIMATIC PCS 7

In SIMATIC PCS 7, Target OS download failures caused by active .LCK files occur when WinCC project databases remain locked by running runtime engines or hanging background processes. WinCC generates .LCK files (such as <Project>.lck and CS.lck) to prevent multi-user write corruption. While .LCK files are deleted automatically when WinCC closes normally, unexpected terminations, network disconnections, or hung processes leave orphan lock files on disk. To resolve this, deactivate WinCC Runtime, terminate background processes using Reset_WinCC.vbs or CCCleaner.exe, and manually delete any remaining *.lck files.

Table of Contents

Purpose and Mechanics of WinCC .LCK Lock Files

In SIMATIC PCS 7 WinCC (v7.x, v8.x, v9.x), the SCADA project consists of Microsoft SQL Server databases, configuration files, and binary graphics:
* The Single-User Write Lock:
To protect configuration integrity, WinCC creates lock files with the .lck extension in the project root directory whenever the project is opened in WinCC Explorer or activated in Runtime:
* <ProjectName>.lck: Primary project file lock preventing simultaneous write access from multiple engineering stations.
* CS.lck: Configuration Studio lock guarding engineering database tables.
* RT.lck: Runtime active lock signaling that alarm logging, tag logging, and communication drivers are executing.
* Automatic Deletion:
Under normal operational conditions, when an engineer closes WinCC Explorer or deactivates WinCC Runtime, the controlling process gracefully unregisters its locks and deletes the .lck files from the disk.

Why OS Downloads Fail Due to Persistent Database Locks

When an engineer initiates a target OS download from SIMATIC Manager (PLC -> Download -> Target OS):
* The Download Pre-Check:
The PCS 7 download executive queries the target OS station via network share. It checks whether the target database is locked.
* The Lock Blockage:
If a target OS station experienced an ungraceful shutdown, a network disruption during an earlier download, or if background processes (such as CCDataMgr.exe or CCProjectMgr.exe) hung in memory, the .lck files remain on disk. The download wizard aborts immediately with an error: 'The project is locked or currently being edited by another user.'

WinCC Lock File Types and Associated Background Processes

The table below outlines common WinCC lock files and their responsible background processes:

Lock File NameAssociated FunctionHolding System ProcessResolution Action<ProjectName>.lckMaster project access lockWinCCExplorer.exe, CCProjectMgr.exeClose WinCC Explorer; run Reset_WinCC.vbsCS.lckConfiguration Database LockCCConfigStudio.exeEnsure all editors (Tag Mgmt, Alarm Logging) closedRT.lckActive Runtime LockCCDataMgr.exe, pdlrt.exeDeactivate Runtime cleanly; check Task Manager<ProjectName>.dcfDynamic Configuration CacheSQL Server (sqlservr.exe)Regenerated automatically; can be deleted offlineWinCC_OA.lckOpen Architecture LockWeb Navigator / OpenPCS 7 serviceStop SIMATIC OpenPCS 7 service in Windows

Step-by-Step Procedure to Safely Clear .LCK Files and Execute OS Download

  1. Deactivate Runtime and Close WinCC on Target OS:
    On the target OS server or client, click Deactivate in WinCC Explorer. Wait for all runtime indicators to stop. Close WinCC Explorer.
  2. Execute WinCC Process Reset:
    * If processes hang, do not rely on standard Windows task killing alone.
    * Open Windows Command Prompt as Administrator.
    * Run the official Siemens reset script:
    C:\Program Files (x86)\Siemens\WinCC\bin\Reset_WinCC.vbs
    * Wait approximately 60 seconds until the prompt returns, indicating all WinCC database handles, Sybase components, and SQL locks are terminated.
  3. Locate and Delete Remaining .LCK Files:
    * Open Windows File Explorer on the target station.
    * Navigate to the OS project directory.
    * In the search box, type *.lck.
    * If any .lck files are found, select and delete them.
  4. Verify Windows Network Share Permissions:
    Ensure the shared project folder has full read/write permissions granted to the SIMATIC HMI Windows user group.
  5. Re-Execute OS Download from Engineering Station:
    Return to SIMATIC Manager on the ES. Right-click the OS object and select PLC -> Download. Select Entire OS or Changes only and proceed. The download will execute without lock errors.

Resolving Network Share and DCOM Permission Lockups

If .lck files are absent but the download wizard still claims the project is locked:
* The Ghost Network Connection:
A remote client or previous engineering session may maintain an active SMB file handle over the network.
* Clearing Open SMB Handles:
On the target OS station, open Computer Management -> System Tools -> Shared Folders -> Open Files. Locate any open files pointing to the WinCC directory and select Close Open File.
* Simatic Shell Settings:
Open Simatic Shell on both ES and OS. Confirm that both stations can ping and resolve each other by NetBIOS name without DNS timeouts.

Verification

To verify that lock files are resolved and download succeeds:
1. Confirm that no .lck files exist in the target OS folder prior to download.
2. Initiate an OS Changes Download from SIMATIC Manager.
3. Confirm that the download progress bar advances through SQL database transfer, graphics copying, and script compilation without aborting.
4. Launch WinCC Runtime on the target OS station. Confirm that Runtime starts smoothly with zero database access errors.

Limitations and Operational Precautions

  • Never Delete .LCK Files While Runtime is Active: Deleting .lck files while WinCC processes are actively writing to SQL databases can corrupt transaction logs and cause catastrophic database detachment. Always ensure processes are fully terminated first.
  • Redundant Server Synchronization: On redundant OS pairs, never download to both servers simultaneously. Always download to Partner Server B, verify runtime, and then download to Partner Server A.
  • Licensing Disclaimer: SIMATIC PCS 7 OS Server packages (6ES7652-0XX08-1XB0) and WinCC options must be validated against the applicable Siemens catalog and authorized distributor quotation.

Engineer FAQ

Technical References

Related Articles

Related Tags

  • WinCC LCK Files
  • Target OS Download
  • Reset_WinCC.vbs
  • CCCleaner
  • Database Lock
  • WinCC Explorer
8 respuestas