Interconnecting Data Block STRUCT Elements to SFC Conditions in SIMATIC PCS 7

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

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:

  1. 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.

  2. 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.

  3. 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:

Addressing ApproachSyntax ExampleSFC Compiler ResolutionMaintainability / Re-usabilityEngineering RecommendationNested Symbolic Dot Syntax"DB_Commands".Start.ValueFails (Generates Textual Interconnection)Poor (Unresolved links)Avoid entirelyAbsolute AddressingDB10.DBX0.0Resolves 100% OKPoor (Breaks if DB struct shifts)Acceptable only for static legacy DBsFlattened Symbolic DB"DB_Commands".Start_ValueResolves 100% OKGood (Single dot level)Recommended for new DB designsCFC Chart Pin RoutingInterconnect DB in CFC -> SFCResolves 100% OKBest Practice (Technological consistency)Highly Recommended in PCS 7

Recommended Solutions: CFC Interconnection vs Absolute Addressing

To resolve the interconnection cleanly within PCS 7 standards:

  1. 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.

  2. 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: replace Commands.Start.Value with Start_Value: BOOL.
    - In the SFC condition, input: "DB_Commands".Start_Value. The SFC resolves the single dot symbol immediately.

  3. 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, enter DB10.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

Related Articles

Related Tags

  • SFC
  • Data Block
  • STRUCT
  • Textual Interconnection
  • Absolute Addressing
6 respuestas