Resolving 'Cannot Delete Text' and Text Library Corruption During SFC Type Updates in PCS 7

Resolving 'Cannot Delete Text' and Text Library Corruption During SFC Type Updates in PCS 7

In SIMATIC PCS 7, the compilation or editor error 'Cannot delete text' (or 'Text cannot be deleted' / 'Cannot read text') when adapting or deleting an SFC Type occurs due to relational database corruption in the STEP 7 project's Text Library (Sprache / Text Library) or orphaned characteristics cross-references. When an engineer modifies characteristics (setpoints, control strategies) on an instantiated SFC Type, obsolete text strings become locked by OS compilation tables. To resolve this, clean up the Text Library in SIMATIC Manager, execute 'File -> Save As... With Reorganization (Slow)', and compile the SFC Type with instance synchronization.

Table of Contents

SFC Types, Characteristics, and the Central Text Library Architecture

In SIMATIC PCS 7, procedural sequential control (batch operations, phase control, reactor clean-in-place sequences) is programmed using Sequential Function Charts (SFC):
* SFC Chart: A standalone, instance-specific sequence diagram.
* SFC Type: A standardized, reusable recipe phase template residing in the Master Data Library. It defines Characteristics (Control Strategies, Setpoints, Process Values, Operating States, and Step/Transition names).

Under the hood, all multilingual text strings assigned to SFC Types—such as step comments, transition conditions, and characteristic enumerations—are not stored directly in the graphical file. They are registered into the central STEP 7 Text Library (hrs database tables):
* Each unique string is assigned an internal integer Text ID.
* When compiling the OS, the OS Compiler queries the Text Library to generate WinCC text records and Alarm Logging message texts.

Root Causes for 'Cannot Delete Text' During SFC Type Adaptation

When an engineer modifies an SFC Type (such as removing a setpoint characteristic, deleting an obsolete step, or modifying a control strategy name) and attempts to save or compile:
* Symptom: The SFC editor or OS Compiler halts with:
SFC type update error: Cannot delete text or Cannot read text.
Attempts to delete the SFC Type entirely fail with the same database lock.
* Root Causes:
1. Orphaned Text References in Relational Tables:
The text ID is still referenced by an instantiated SFC Plan, an OS Server text cache, or a compiled Function Block (FB) interface. When the SFC editor attempts to delete the string from the Text Library, the relational database constraint detects a foreign key conflict and aborts.
2. Interrupted OS Compilation:
A previous AS-OS compilation crashed or was aborted while writing to the WinCC text pool, leaving transaction lock flags active in the project database.
3. Multi-Language Inconsistency:
Text strings were defined in German (de-DE) and English (en-US), but a deletion was executed while the SIMATIC Manager project language was set to a third non-matching locale.

Database Cross-Reference Locking Between SFC and WinCC OS

A critical architectural link connects SFC Types and WinCC OS:
* When an SFC Type is created, the system automatically generates an associated Function Block (FB) and WinCC Structure Type.
* In WinCC, the SFC Visualization package (@SFC_...pdl) loads step names dynamically.
* If an engineer attempts to delete a characteristic in the AS while the WinCC OS project retains compiled pointers to that exact string ID, the project database protects cross-system integrity by blocking the deletion.

SFC Type Troubleshooting and Recovery Matrix

The following matrix compares recovery procedures for corrupted SFC Types:

Remediation WorkflowDatabase ImpactRequires AS Stop?Success RateText Library Clean Up via SIMATIC ManagerPurges unreferenced text IDsNO (Offline DB fix)HighSave As With Reorganization (Slow)Rebuilds relational tables and indexesNO (Changes-only compile)Very HighDelete SFC Instances in AS ChartsRemoves foreign key dependenciesNO (If re-instantiated)HighDirect Deletion of Generated FBDestroys instance DB pointersInadvisable (Breaks delta)ModerateExtract to Pristine ProjectComplete database re-initializationTurnaround required100% Guaranteed

Step-by-Step Procedure to Repair Corrupted SFC Types

Follow this procedure to eliminate the 'Cannot delete text' error and update the SFC Type:
1. Clean Up Text References in SIMATIC Manager:
- Close the SFC editor and all CFC charts.
- In SIMATIC Manager, select the S7 Program containing the SFC Type.
- In the menu bar, select Options -> Manage Multilingual Texts -> Delete Language... or Export / Clean Up.
- Purge unused text entries from the project's Text Library table.
2. Execute Database Reorganization (Slow):
- Close all open editors (CFC, SFC, HW Config, WinCC).
- In SIMATIC Manager, select File -> Save As....
- Check the box With Reorganization (Slow).
- Save the project under a new name on a local solid-state drive (C:\ or D:\).
- Allow the process to complete (this rebuilds all Sybase database indexes and purges orphaned text pointers).
3. Open the Reorganized Project and Update SFC Type:
- Open the newly reorganized project.
- Navigate to the Master Data Library or S7 Program.
- Open the SFC Type: Confirm that it opens without displaying the 'Cannot read text' error.
- Apply your characteristic modifications or delete obsolete steps.
- Select Options -> Update SFC Instances to propagate changes across all chart instances.
4. Compile AS and OS:
- In SIMATIC Manager, right-click the Charts folder and select Compile -> Charts as Program -> Scope: Changes only.
- Compile the OS (Scope: Changes only).
- Confirm that both compilations complete with 0 Errors and zero text deletion warnings.

Verification

Verify that SFC Type editing and compilation integrity are fully restored:
1. Open the modified SFC Type: Verify that steps, transitions, and characteristics display valid text without error prompts.
2. In CFC, open an instantiated SFC chart: Verify that the updated characteristics reflect the new configuration.
3. Execute an OS compilation: Confirm the compilation log reports: Compiled without errors and that SFC Visualization texts compile cleanly.
4. Open WinCC Runtime: Confirm that the SFC faceplate opens, displaying correct step descriptions and active transition conditions.

Limitations and Operational Precautions

  • Never attempt to edit the underlying Sybase relational database tables directly using third-party SQL tools; doing so destroys cryptographic database signatures and permanently corrupts the project.
  • When managing multilingual text in SFC Types, always set the project default language in SIMATIC Manager to the primary engineering language before editing characteristics.
  • Always archive the Multiproject before modifying SFC Types that are widely instantiated across production units.

Engineer FAQ

Why did 'Save As With Reorganization (Slow)' resolve the text error?

Reorganization evaluates all active database pointers, discards orphaned text strings whose parent objects were deleted, and rebuilds the project's Text Library index from scratch.

Can I delete an SFC Type if instances still exist in CFC charts?

No. The system enforces strict referential integrity. An SFC Type cannot be deleted from the library or block folder as long as a single instantiated SFC block exists in any CFC chart.

What is the difference between an SFC Chart and an SFC Type?

An SFC Chart is an individual sequence created directly in a chart folder. An SFC Type is an object-oriented template defined in the Master Data Library that can be instantiated multiple times as standard Function Blocks in CFC charts.

Technical References

Related Articles

Related Tags

  • SIMATIC PCS 7 V8.1
  • SFC Types
  • Text Library
  • Database Repair
  • SFC Engineering
6 respuestas