Resolving Error 299:207 during CFC Compilation and Restoring Corrupted Chart Databases
Error 299:207 ('Error during last saving; user text could be erroneous') during CFC compilation in SIMATIC PCS 7 indicates an internal relational database corruption or damaged index pointers within the STEP 7 chart container. This occurs following an abrupt editor termination, interrupted multi-user write operation, or an incomplete block type import. To resolve it, close all CFC and SFC editors, execute 'File > Save As... with Reorganization (slow)' in SIMATIC Manager to rebuild database tables, update block types in the chart folder, and perform a full CFC consistency check.
Table of Contents
- Executive Summary
- Architecture and Fundamental Mechanics
- Step-by-Step Implementation Procedure
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Executive Summary
In SIMATIC PCS 7 (V8.0 through V9.1), the Continuous Function Chart (CFC) editor stores graphical layouts, interconnections, and block parameters in an internal relational database structure within the project's S7 program container. When an unexpected system event occurs—such as a power failure, network share timeout during multi-user engineering, or an abrupt task termination during a save operation—the database write transaction is interrupted. Subsequent attempts to compile or save charts produce Error 299:207. Simply restoring an older archive that contains the same corrupted index will not fix the issue. This article provides the definitive engineering procedure to rebuild the database, eliminate orphaned pointers, and restore project integrity.
Architecture and Fundamental Mechanics
Internal Database Architecture and Mechanics of Error 299:207:
- The CFC Relational Database Structure:
- Within a STEP 7 project directory, the chart container (
s7f/s7dfolders) maintains relational database tables tracking block instances, graphical positions, signal interconnection pointers, and user text/comments. -
When saving a chart, the CFC editor executes transactional updates: writing new parameters, updating symbol cross-references, and re-indexing block execution sequence lists.
-
Root Causes of Error 299:207:
- Interrupted Save Transaction: If SIMATIC Manager or the workstation shuts down while the database index files (
.idx,.dbf) are being updated, table headers become inconsistent with actual record lengths. - Orphaned User Text Pointers: Error 299:207 explicitly identifies that 'user text could be erroneous'. This indicates that textual comments, chart documentation fields, or block pin textual interconnections have lost their parent relational foreign keys.
-
Corrupt Multi-Project Sync: In shared engineering environments, concurrent writes without proper master-replica locks can corrupt the chart reference tables.
-
The 'Save As with Reorganization (slow)' Recovery Engine:
- Standard 'Save As' performs a raw binary file copy of the project folder, replicating any existing database index corruptions.
- 'Save As with Reorganization (slow)' (Speichern unter mit Reorganisation): Reads project records record-by-record, parses every valid relational table entry, discards deleted records and orphaned pointers, defragments storage pages, and rebuilds all index structures from scratch. This cleanses damaged relational structures that cause Error 299:207.
Step-by-Step Implementation Procedure
Step-by-Step Procedure to Resolve Error 299:207 and Rebuild Project Database:
- Close All Active Project Editors:
- Save any pending work in unaffected projects.
- Close all CFC charts, SFC charts, HW Config, NetPro, and WinCC Explorer.
- Ensure no background processes (e.g.s7tgtopx.exe,s7cfcapp.exe) are accessing the project files. - Perform 'Save As with Reorganization (slow)':
- In SIMATIC Manager, select the top-level Project or Multiproject folder.
- Select menu File -> Save As....
- In the Save As dialog, select the radio button With reorganization (slow).
- Specify a new destination folder on a fast local solid-state drive (do not reorganize directly across a network share).
- Enter a new project name and click OK.
- Allow the reorganization process to complete without interruption (this may take 5 to 30 minutes depending on project size). - Update Block Types in Chart Folder:
- Open the newly reorganized project in SIMATIC Manager.
- Navigate to the S7 Program -> Charts folder.
- Open any CFC chart -> select menu Options -> Block Types.
- Select all blocks in the chart folder and click New Version... (or Clean Up).
- This forces the CFC compiler to synchronize block interface timestamps with master library definitions. - Execute CFC Chart Consistency Check:
- In the CFC editor, select menu Options -> Check Consistency -> Charts as Program.
- Review the generated consistency log to ensure no orphan cross-references or missing textual connections remain. - Recompile CFC Charts:
- Select Chart -> Compile -> Charts as Program.
- Select Scope: Entire program and check Generate module drivers.
- Confirm compilation completes with 0 errors.
Verification
Verification Procedure:
1. Compilation Log Verification: Inspect the CFC compilation log window. Confirm the compile finishes with 0 Errors, 0 Warnings and Error 299:207 is completely eliminated.
2. Chart Inspection: Open the specific CFC charts that previously triggered the error. Verify that all block text, pin names, and comments render correctly.
3. Test Save Operation: Modify a non-critical block comment or parameter on a chart; press Ctrl+S. Confirm that the save operation completes instantaneously without error dialogs.
Limitations and Operational Precautions
Operational Precautions and Multi-User Engineering Guidelines:
- Always Work Locally: Never edit or compile PCS 7 projects directly over unbuffered Windows network shares or mapped drives. Network latency or transient disconnects are the leading cause of database index corruption.
- Archive Frequency: Maintain regular multi-project archives using SIMATIC Manager's built-in PKZip archiving tool before performing major library updates or structural changes.
- Technical Support Escalation: If 'Save As with Reorganization' fails to repair Error 299:207 due to severe physical file corruption, generate a service request with Siemens Industry Technical Support; specialized internal database tools (S7DBFix) can often repair proprietary table headers.
Engineer FAQ
What does Error 299:207 signify in PCS 7 CFC?
It signifies an internal database index inconsistency or corrupted user text table record caused by an incomplete save transaction.
Why did restoring an older project archive fail to fix Error 299:207?
If the older archive was taken after the database index became fragmented or if corrupted temporary files lingered in the workspace, the error will re-manifest upon compilation.
What is the difference between standard Save As and Save As with Reorganization?
Standard Save As performs a direct file copy. Reorganization rebuilds all database tables record-by-record, eliminating deleted records, orphaned pointers, and corrupted indexes.
Can Error 299:207 cause controller stoppage during runtime?
Error 299:207 prevents CFC compilation and downloading from the ES. It does not cause a running AS to stop unless an engineer downloads an inconsistent program.
How long does 'Save As with Reorganization (slow)' take?
Depending on project size and whether it is a single project or multiproject, reorganization typically takes between 5 and 30 minutes.
Technical References
- SIMATIC Process Control System PCS 7 CFC for S7 / S7-FH Manual
- SIMATIC Process Control System PCS 7 Engineering System Manual
- Siemens Industry Online Support Service Request Guidelines
Related Articles
- Removing Locked Interconnections, Text References, and Un-deletable Links in CFC Charts
- Managing S7-400 Local Data Stack Allocation and Resolving CFC Compilation Exhaustion
- Enabling Test Mode in SFC and Distinguishing SFC Types from SFC Instances in PCS 7
Related Tags
- CFC Error 299:207
- Save As Reorganization
- Database Repair
- STEP 7 Database
- CFC Compilation