Interconnecting Data Block STRUCT Elements to SFC Conditions in SIMATIC PCS 7
In SIMATIC PCS 7 Sequential Function Charts (SFC), attempting to interconnect a nested user Data Block STRUCT element (such as Commands.Start.Value) to an SFC transition condition using symbolic dot syntax results in an unresolved textual interconnection. The SFC compiler does not support multi-level symbolic navigation into nested structures of shared Data Blocks. To successfully evaluate struct elements in an SFC, engineers must either use absolute addressing (e.g., DB10.DBX0.0), route the struct signal through a CFC chart pin to expose it as a clean chart interconnection, or flatten the Data Block definition into elementary named scalar variables.
Table of Contents
- Data Block Structure Evaluation in the SFC Compiler
- Why Multi-Level Symbolic Dot Syntax Generates Textual Interconnections
- SFC Operand Addressing Methods and Compatibility Matrix
- Recommended Solutions: CFC Interconnection vs Absolute Addressing
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Data Block Structure Evaluation in the SFC Compiler
In SIMATIC STEP 7 and PCS 7, shared Global Data Blocks (DBs) allow developers to organize complex automation parameters into nested hierarchical data structures using user-defined types (UDTs) or structured declarations (e.g., Commands containing nested struct Start containing boolean Value).
When constructing Sequential Function Charts (SFCs), step actions and transition conditions frequently need to evaluate status flags or write setpoints to these global data structures. While Continuous Function Chart (CFC) supports structural interconnections between compatible block pins, the SFC editor condition parser evaluates global operands through a dedicated symbol table resolution mechanism that possesses strict architectural constraints regarding nested structures.
Why Multi-Level Symbolic Dot Syntax Generates Textual Interconnections
When an engineer types a symbolic path such as "DB_Commands".Start.Value directly into an SFC transition condition dialog, the SFC editor displays the text in yellow or generates a Textual Interconnection:
-
Symbolic Parser Limitation: The SFC condition parser is designed to resolve two-part symbols:
"Symbolic_DB_Name".Variable_Name. When presented with three or more dot-delimited tokens (DB.Struct.SubStruct.Element), the symbol parser fails to traverse the compiled data block symbol tree and treats the expression as an unresolved text label. -
Textual Interconnection Warning: During compilation, the compiler warns that textual interconnections cannot be closed. If left unresolved, the transition condition defaults to
FALSE, preventing sequence advancement. -
Contrast with Absolute Addressing: If the user inputs the direct memory location (e.g.,
DB10.DBX0.0), the compiler resolves the pointer instantly, bypassing the symbol engine.
SFC Operand Addressing Methods and Compatibility Matrix
The following table compares addressing techniques for connecting global DB variables into SFC conditions:
"DB_Commands".Start.ValueDB10.DBX0.0"DB_Commands".Start_ValueRecommended Solutions: CFC Interconnection vs Absolute Addressing
To resolve the interconnection cleanly within PCS 7 standards:
-
Method 1: CFC Chart Interconnection (PCS 7 Best Practice):
- Place your SFC as a block in a CFC chart, or open the SFC external view in CFC.
- Create a binary input pin on the SFC (or use an SFC Type technological condition input).
- In the CFC chart, connect the global DB struct element directly to the SFC block pin. CFC's compiler resolves nested DB struct elements without error and maps the address cleanly to the SFC interface. -
Method 2: Flatten the Data Block Definition:
- In the S7 Program's DB editor, flatten nested structures so that variables reside at the top level: replaceCommands.Start.ValuewithStart_Value: BOOL.
- In the SFC condition, input:"DB_Commands".Start_Value. The SFC resolves the single dot symbol immediately. -
Method 3: Absolute Memory Addressing (Workaround):
- Open the DB in the LAD/FBD/STL editor to identify the exact byte and bit offset (e.g., byte 0, bit 0).
- In the SFC transition condition, enterDB10.DBX0.0.
- Note: If data types or preceding variables in DB10 are altered later, absolute addresses must be manually audited.
Verification
Verify condition resolution:
1. In the SFC editor, open the transition condition dialog. Verify that the address text displays in standard black font (not yellow, which indicates an open textual interconnection).
2. Compile the CFC/SFC chart folder (Chart -> Compile -> Changes Only).
3. Ensure the compilation log confirms: 0 Textual interconnections open, 0 Errors.
4. Go online with the SFC. Toggle the DB bit in a variable table (VAT) and confirm the transition condition evaluates to TRUE (1) in real time.
Limitations and Operational Precautions
- Absolute Address Shifting: If using absolute addressing (
DB10.DBX0.0), inserting variables into the DB shifts all subsequent offsets, causing the SFC to evaluate incorrect memory locations without compiler warning. - SFC Type Constraints: In SFC Types, external interconnections cannot be hardcoded inside the type; inputs must be exposed on the SFC Type interface and interconnected at the instance chart level.
- Close Textual Interconnections: Never download an SFC containing unresolved textual interconnections; the affected transitions will remain permanently disabled.
Engineer FAQ
Why does CFC allow connecting struct elements while SFC rejects them?
CFC uses an advanced graphical cross-reference engine that resolves internal DB byte/bit offsets dynamically. SFC's internal condition editor only supports single-level symbol lookup.
Can I use absolute addressing in an SFC Type?
No. SFC Types enforce generic object-oriented encapsulation. All external signals must be routed through the SFC Type interface pins.
What happens if a textual interconnection remains open during compilation?
The CFC compiler issues a warning, and at runtime, the open textual condition evaluates as permanently FALSE.
Can I interconnect a UDT instance to an SFC condition?
Only if routed through a CFC chart pin. Directly typing UDT child elements inside the SFC condition editor fails with textual interconnection errors.
Technical References
- SIMATIC Process Control System PCS 7 SFC for SIMATIC S7 (V9.0 SP1) Programming and Operating Manual
- SIMATIC Process Control System PCS 7 CFC for S7 (V9.0) Configuration Manual
- Siemens Industry Online Support: Interconnecting Data Types and Parameters in CFC (Entry ID: 22258908)
Related Articles
- Why S7_xm_c Structure Tags Fail in Shared Data Blocks but Work in Function Blocks in PCS 7
- Implementing Conditional Branching with Operator Confirmation in PCS 7 SFC Types
- Decoding and Commanding PCS 7 SFCs via the SFC_CONTROL Interface Word
Related Tags
- SFC
- Data Block
- STRUCT
- Textual Interconnection
- Absolute Addressing