Resolving CFC Compilation Locks and Avoiding Full Downloads Due to Open Data Blocks
Attempting to compile CFC charts while a Data Block (DB) is open in the LAD/FBD/STL editor locks the database file, aborting compilation and invalidating the compiler's delta timestamp. Once a delta timestamp is broken, the system disables 'Changes only' and forces an 'Entire program' compilation and download. There is no supported or safe Windows registry modification to bypass this integrity check; forcing a delta download with mismatched timestamps trips the CPU into STOP mode (OB121). The correct engineering remedy is closing all block editors, executing 'Save As... With Reorganization (Slow)', and compiling charts cleanly.
Table of Contents
- Mechanics of CFC Delta Timestamps and DB File Locks
- The Myth of Registry Hacks and Fatal CPU Stop Risks
- Standard Procedure to Clear File Locks and Re-enable Delta Compiles
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Mechanics of CFC Delta Timestamps and DB File Locks
In SIMATIC PCS 7, Continuous Function Chart (CFC) programming abstracts PLC memory allocation. When compiling CFC charts, the compiler automatically generates instance Data Blocks (DBs) for function blocks and allocates memory addresses.
To enable online delta downloading without stopping the industrial process (Download -> Changes only), the CFC compiler maintains strict synchronization between three timestamps:
1. Time of Code Change: Recorded in the chart database.
2. Time of Interface Compilation: Embedded within the compiled S7 blocks.
3. Time of Download: Stored in the active work memory of the S7-400 / S7-410 CPU.
If an engineer opens a generated Data Block (e.g., DB 105) in the classic STEP 7 block editor while initiating CFC compilation:
* The Step 7 database engine places an exclusive file lock on the open DB.
* The CFC compiler attempts to overwrite the DB file to reflect new chart interconnections, fails due to access denial, and throws an error dialog.
* Because the compilation aborted mid-stream, internal consistency records become misaligned. The compiler flags the database as "Inconsistent", disabling the "Changes only" radio button and permitting only Entire program compilation.
The Myth of Registry Hacks and Fatal CPU Stop Risks
Engineers facing an unexpected "Entire download" prompt in a running production facility often search for undocumented Windows Registry modifications to artificially re-enable the delta download button.
Siemens system architecture strictly prohibits this approach:
* The CPU Hardware Check: Even if a third-party script or registry hack were to manipulate the engineering GUI, the S7-400 operating system performs an autonomous firmware-level check when receiving downloaded blocks.
* Interface Mismatch Fault (OB 121): If a downloaded block possesses an interface timestamp or memory structure that does not match the CPU's existing memory layout, the CPU declares a critical software error.
* Controller Crash: Unless specific fault-handling Organization Blocks (such as OB 121 / OB 85) are engineered with complex masking, an interface discrepancy immediately trips the CPU into STOP mode, causing an uncommanded, total plant shutdown.
Standard Procedure to Clear File Locks and Re-enable Delta Compiles
To clear residual database locks and recover delta compilation capabilities safely without forcing a full plant shutdown:
- Close All External Editors:
* Close the LAD/FBD/STL block editor, Symbol Editor, Variable Tables (VAT), and HW Config.
* Ensure no other engineering laptops have the multiproject checked out in multi-user mode. - Rebuild the Step 7 Database (Reorganization):
* In SIMATIC Manager, close all open CFC charts.
* Select File -> Save As....
* Check the radio button With Reorganization (Slow).
* Save the project to a new local path. This purges orphaned file locks, defragments the database, and recalculates cross-reference pointers. - Execute Clean Chart Compilation:
* Open CFC. Select PLC -> Compile -> Charts as Program.
* Check if Changes only has become re-enabled.
* If "Changes only" is available, compile changes cleanly.
* If the compiler still mandates an entire compile, compile the entire program on the offline project, but do not download. Compare the block timestamps against the online CPU using PLC -> Compare Blocks to identify which specific DB was altered.
Verification
- In CFC, open the compile dialog. Confirm that Changes only executes to 100% with zero errors.
- In SIMATIC Manager, initiate PLC -> Download -> Changes only. Confirm that the download dialog confirms change-mode download without prompting for CPU STOP.
- Check the CPU diagnostic buffer (
PLC->Module Information). Confirm that no timestamp mismatch or interface conflict warnings are recorded.
Limitations and Operational Precautions
- Never open auto-generated instance DBs (blocks created by CFC) in the classic Step 7 block editor. Instance DBs should be viewed exclusively through dynamic CFC chart test mode.
- If a structural interface change was genuinely made to a custom block (e.g., adding an input pin to a user FB), a delta download is mathematically impossible without Type Update in RUN (TCiR) on an S7-410 controller.
- Always maintain an up-to-date project archive prior to performing any database reorganization.
Engineer FAQ
- Why does CFC generate instance DBs that can be opened in Step 7?
CFC is built on top of the classic Step 7 engineering engine. The generated DBs exist in the offline block folder so the compiler and OS compilation wizards can access them, but they are managed dynamically by CFC. - What should I do if a DB is permanently locked after a PC crash?
If a computer crash leaves a locked database file, reboot the engineering workstation to release orphaned Windows handles, or use the "Save As... With Reorganization (Slow)" workflow. - Can Type Update in RUN (TCiR) solve this problem?
Yes. If using a CPU 410-5H with TCiR, even if block interfaces change and mandate an entire compilation, the program can still be downloaded in RUN without stopping the controller.
Technical References
- SIMATIC PCS 7 CFC for S7 / M7 Manual (A5E41356247-AA).
- Siemens Industry Online Support Entry ID 109801081: Avoiding Entire Program Downloads in SIMATIC PCS 7.
- S7-400 / CPU 410 Diagnostic Buffer and Fault Handling System Manual.
Related Articles
- Best Practices for Avoiding Unintended CPU STOP Conditions During Online Downloads.
- Understanding Time Stamps and Block Consistency Checks in STEP 7 and CFC.
Related Tags
PCS 7, CFC, Data Blocks, Compilation Errors, Delta Download, S7-400, Reorganization, Troubleshooting