Resolving Quotation-Marked 'TRUE' and 'FALSE' Keyword Conflicts in SIMATIC PCS 7 SFC
In SIMATIC PCS 7 SFC, boolean literals display in quotation marks ("TRUE", "FALSE") when an engineer has erroneously created symbols named TRUE or FALSE in the STEP 7 Symbol Table, causing the compiler to treat boolean constants as variable references. Resolve this without recreating SFC charts by deleting the symbol entries from the Symbol Table, executing 'Check Consistency' across the chart folder, and running a program compile.
Table of Contents
- Symptom Description: Keyword Collisions in SFC Logic
- STEP 7 Symbol Prioritization and SFC Lexical Parsing
- Step-by-Step Remediation Workflow Without Recreating Charts
- SFC Operand Formatting and Literal Evaluation Matrix
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Symptom Description: Keyword Collisions in SFC Logic
In SIMATIC PCS 7 sequential control engineering, Sequential Function Chart (SFC) transitions and step actions evaluate boolean criteria (e.g. checking whether a pump has started or forcing an interlock bypass). Normally, boolean constants are entered and rendered as bare keywords: TRUE (or 1) and FALSE (or 0).
A frustrating problem occurs when a project engineer inadvertently defines variables named TRUE or FALSE inside the STEP 7 Symbol Table (for example, assigning symbol TRUE to memory flag M 0.0 or a global DB bit):
* Immediately across all existing and new SFC charts, transition conditions and step assignments containing TRUE or FALSE are transformed to appear encased in double quotation marks: "TRUE" and "FALSE".
* The SFC engine ceases treating them as literal boolean values; instead, it binds them as symbolic variable references pointing to the memory bit in the symbol table.
* If the memory bit is uninitialized or 0, transitions expecting a constant TRUE evaluate to FALSE, completely freezing sequence execution.
* If the engineer simply deletes the symbols from the Symbol Table, the quotation marks do not disappear automatically. Instead, SFC flags them as unresolved/invalid symbols ("TRUE" in red or yellow), and attempts to compile abort with syntax errors.
Engineers often believe they must manually delete and re-author every SFC chart from scratch. However, systematic database reconnection procedures resolve the collision cleanly.
STEP 7 Symbol Prioritization and SFC Lexical Parsing
To understand why deleting the symbol leaves orphan quotes, consider how the STEP 7 and CFC/SFC parser resolves operands:
-
Lexical Scope Priority:
* STEP 7 enforces symbolic addressing. When a token matches an entry in the project Symbol Table, the symbol resolver takes priority over language keywords.
* Creating a symbol namedTRUEoverrides the literal constantTRUE. In STEP 7 conventions, symbolic operands are formatted with enclosing double quotation marks (e.g."Motor1_Start","TRUE"). -
Database Binding in SFC:
* When an operand is bound to a symbolic address, SFC stores an internal relational database link to the symbol table entry ID in the project chart database (CHART.DB).
* When the symbol is deleted from the Symbol Table, the database link is broken, leaving an orphaned symbol reference string ("TRUE"). The SFC compiler interprets this not as the literal boolean value, but as an undefined variable. -
Re-establishing Literal Constant Binding:
* To convert an unresolved symbolic operand back into a native boolean keyword, the lexical parser must be forced to re-evaluate the string as a literal value (TRUE = 1,FALSE = 0) rather than a variable identifier.
Step-by-Step Remediation Workflow Without Recreating Charts
1. Purge Reserved Keywords from the Symbol Table
- In SIMATIC Manager, expand the S7 Program folder and double-click Symbols.
- Locate any entries where the Symbol column is named
TRUE,FALSE,true,false,True, orFalse. - Right-click the entire row and select Delete.
- Select Table > Save and close the Symbol Table editor.
2. Execute Global Chart Consistency Check
- In SIMATIC Manager, select the Charts container folder.
- Select menu Options > CFC > Check Consistency (or Options > Check Consistency).
- The utility scans all charts, rebuilds symbol cross-references, and detects missing symbol links.
- Allow the consistency check to complete.
3. Clear Orphaned Symbols in Affected SFC Charts
If individual transitions still display "TRUE" in quotation marks:
1. Open the affected SFC chart.
2. Open the transition or step action editor.
3. Click into the operand value field containing "TRUE".
4. Enter numeric 1 (for TRUE) or 0 (for FALSE) directly into the value field, or type TRUE without quotes, and press Enter.
5. Notice that the editor formats numeric 1 as standard keyword TRUE (with no quotation marks).
6. Repeat for remaining affected transitions in the chart.
4. Global Rewiring and Program Compilation
- In SIMATIC Manager, select the Chart folder.
- Select Options > Rewire... if symbols were remapped.
- Execute PLC > Compile and Download Objects.
- Select Charts, configure Scope: Entire Program, and execute compilation.
- Verify that compilation completes with 0 Errors.
SFC Operand Formatting and Literal Evaluation Matrix
TRUE (No quotes)FALSE (No quotes)"TRUE" (Quotation marks)TRUE1TRUE0FALSEVerification
- Open the SFC chart and examine transition conditions that previously displayed
"TRUE". - Confirm the condition renders cleanly as
TRUE(blue keyword text, zero double quotation marks). - Execute Chart > Compile > Entire Program in the CFC/SFC editor.
- Confirm compilation finishes with 0 Errors.
- Download to S7-PLCSIM; enter SFC Test Mode and verify that transitions with condition
TRUEimmediately pass when preceding steps complete.
Limitations and Operational Precautions
- Reserved Name Discipline: Never use programming language keywords (
TRUE,FALSE,AND,OR,NOT,BYTE,WORD,REAL) as symbol names in the STEP 7 Symbol Table or CFC block instances. - Scope of Consistency Check: Running 'Check Consistency' across thousands of charts in a large multiproject may take several minutes; ensure no other engineers have charts open over shared network paths during the check.
- Always Compile Entire Program: After clearing symbol table conflicts, compiling 'Changes only' may skip charts that were not graphically edited. Always perform an 'Entire program' compilation to force compiler database re-indexing.
Engineer FAQ
Why did typing numeric '1' fix the quotation mark problem?
In the STEP 7 lexical parser, numeric digits 1 and 0 are strictly interpreted as constants. Entering 1 forces the parser to store a constant, which the SFC graphical interface automatically renders as keyword TRUE.
Can this same symbol collision happen in CFC charts?
Yes. If TRUE or FALSE is defined in the symbol table, connecting a pin to a textual interconnection or constant value can bind to the symbol rather than the boolean literal.
Does deleting the symbol table affect downloaded controller logic before a new download?
No. The controller continues running the compiled machine code in memory until a new program download is executed.
Technical References
- SIMATIC Process Control System PCS 7 SFC for S7 (V8.1) Programming and Operating Manual
- SIMATIC STEP 7 V5.5 Managing Multiprojects and Symbol Tables
- Siemens Industry Online Support: Naming Conventions and Reserved Words in SIMATIC PCS 7 (SIOS Entry ID 109780813)
- IEC 61131-3: Programmable Controllers - Programming Languages
Related Articles
- Resolving Disabled Control Buttons and Freezes in SIMATIC PCS 7 SFC Test Mode
- Troubleshooting Broken Textual Interconnections in SIMATIC PCS 7 CFC
- Best Practices for S7 Project Reorganization and Database Health
Related Tags
- SFC
- Symbol Table
- Boolean Constants
- TRUE/FALSE
- CFC
- Syntax Error