How to Connect Raw Data Block Booleans to APL Multi-Input Logic Blocks in PCS 7 CFC
In SIMATIC PCS 7 CFC, raw boolean tags from standard Data Blocks (DBs) cannot be connected directly to APL logic blocks (such as And04, And08, Or04, Or08 in the LogicDi folder) because APL blocks require structured data types containing both a boolean Value and a signal status byte (ST). To connect DB booleans, either expand standard elementary logic gates from the BIT_LGC folder by right-clicking the block and selecting 'Number of I/Os...', use the conversion block StruDiOu from the Convert folder to wrap the boolean into an APL structure, or expand the structured pin in CFC by clicking '+' to interconnect directly to the .Value element.
Table of Contents
- Data Type Incompatibility: Elementary BOOL vs APL Structured Signals
- Method 1: Expanding Elementary BIT_LGC Logic Gates to Multiple Inputs
- Method 2: Converting Elementary Booleans with StruDiOu (Convert Library)
- Method 3: Expanding Structure Elements Directly in the CFC Editor
- Comparison of Logic Connection Methods in PCS 7 CFC
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Data Type Incompatibility: Elementary BOOL vs APL Structured Signals
In SIMATIC PCS 7 CFC engineering, newly integrated automation engineers frequently encounter a frustrating barrier: a boolean tag located in a global Data Block (e.g., DB100.DBX0.0) can be connected easily to a 2-input AND gate in the BIT_LGC library, but dragging that same tag onto an And04 or Or08 block from the LogicDi folder displays a prohibited cursor (circle with a slash).
This occurs because PCS 7 enforces strict type checking:
* Elementary Data Types (BIT_LGC): Classic STEP 7 logic blocks (AND, OR, XOR) operate on basic IEC 61131-3 BOOL variables (1 bit: 0 or 1).
* APL Structured Data Types (LogicDi): All blocks in the Advanced Process Library (APL) utilize structured data types to propagate signal quality alongside process data. An APL digital input (such as In1 on And04) is defined as a STRUCT:
* Value : BOOL (the actual binary signal state)
* ST : BYTE (the signal quality status conforming to IEC 61804).
* A raw DB boolean lacks the ST byte, causing the CFC compiler to reject the direct connection to protect signal status integrity.
Method 1: Expanding Elementary BIT_LGC Logic Gates to Multiple Inputs
If your application only requires multi-input boolean logic without needing APL signal status propagation:
- Insert Elementary Gate:
* Open the CFC chart.
* In the block catalog underLibraries > Standard Library > Blocks > BIT_LGC, drag anAND(orOR) block onto the chart. - Expand Number of Inputs:
* By default, theANDblock displays only two inputs (In1andIn2).
* Right-click theANDblock header and selectNumber of I/Os....
* In the dialog box, enter the desired number of inputs (from2up to32inputs).
* ClickOK. The CFC editor expands the block dynamically, creatingIn3,In4, ...,In32. - Connect DB Booleans:
* Drag boolean variables from any global Data Block directly onto any of the expanded input pins. All connections are accepted without type mismatch errors.
Method 2: Converting Elementary Booleans with StruDiOu (Convert Library)
When the output of the boolean logic must feed directly into APL equipment blocks (such as VlvL.Intlock or MotL.Permit), the signal must carry a valid APL structure:
- Insert
StruDiOu:
* In the CFC block catalog, navigate toLibraries > PCS 7 AP Library > Blocks > Convert.
* Drag the blockStruDiOu(FB1253 - Structure Digital Output) onto the chart. - Configure Conversion Inputs:
* Connect your DB boolean tag (e.g.,DB100.DBX0.0) toStruDiOu.In.
* Configure parameterSubsST: Set to16#80(Good) to establish a valid quality code. - Interconnect to APL Logic Blocks:
* ConnectStruDiOu.Outdirectly toAnd04.In1orOr08.In2.
* BecauseStruDiOu.Outis an APL-compliant digital structure (Struct: Value, ST), the connection is accepted cleanly, and the APL block propagates16#80downstream.
Method 3: Expanding Structure Elements Directly in the CFC Editor
The fastest method to connect a raw DB boolean directly to an APL block without adding extra converter blocks is using sub-element expansion:
- Locate the Structured Pin:
* On theAnd04orOr08block in CFC, locate the input pin (e.g.,In1). - Expand the Structure:
* In the CFC editor, notice the small square plus icon(+)immediately to the left of the parameter nameIn1.
* Click the(+)icon. The parameter expands vertically, exposing its sub-elements:In1.Value(Data Type:BOOL)In1.ST(Data Type:BYTE)
- Connect Raw Boolean to
.Value:
* Drag the DB boolean directly onto the exposedIn1.Valuepin. The connection is accepted immediately! - Assign Signal Status:
* SetIn1.STto16#80(Hexadecimal 80 = Good) in the parameter value column. This ensures the block recognizes the input as valid healthy data.
Comparison of Logic Connection Methods in PCS 7 CFC
The table below compares the three methods for handling multi-input boolean logic in PCS 7 CFC charts.
BIT_LGC InputsAND / ORStruDiOuLogicDi / And04(+)LogicDi / And04Verification
To confirm that Data Block connections function properly:
1. In CFC, verify that all interconnected lines appear solid green without dashed conversion errors.
2. Select Chart > Compile > Changes Only. Confirm that compilation completes with zero errors.
3. Switch CFC to Test Mode (Debug > Test Mode).
4. Force or toggle the DB boolean value in a Variable Table (VAT) or online DB monitor.
5. Confirm that the input state on the logic block updates dynamically and the logic gate evaluates the output correctly.
Limitations and Operational Precautions
- When using sub-element expansion (
In1.Value), never leaveIn1.STunconfigured; an unassigned status defaults to16#00(Bad), which will cause APL downstream blocks to flag an interlock fault. - Do not mix elementary
BIT_LGCgates and APL structured blocks haphazardly; mixing creates scattered quality codes that complicate plant-wide alarm diagnostics. - Avoid expanding elementary
AND/ORgates beyond 16 inputs on high-frequency cyclic OBs (like OB38 @ 10ms), as large bitwise evaluations can increase task jitter. - In safety programs (F-CFC), never use standard
BIT_LGCor APL blocks; fail-safe logic requires dedicated F-library blocks (F_AND4,F_OR4).
Engineer FAQ
Why does the cursor show a prohibited sign when dragging a DB bit to And04?
CFC enforces strict data type compatibility. The DB tag is an elementary BOOL, whereas And04.In1 is a structured data type requiring both a Value (BOOL) and a ST (BYTE). Dragging an elementary type onto a structured pin triggers a type mismatch error.
What does signal status 16#80 mean in PCS 7?
16#80 represents 'Good' quality according to the IEC 61804 fieldbus standard. It indicates that the process value originates from a healthy, validated source without communication errors or hardware faults.
Can I connect an APL structured output to a raw Data Block boolean?
Yes, by expanding the structured output pin using the (+) icon and dragging from the exposed .Value pin into the Data Block address in CFC.
Technical References
- SIMATIC PCS 7 CFC for S7 Programming Manual
- Siemens Industry Online Support FAQ: Data Types and Structure Connections in CFC
Related Articles
- Understanding Signal Status Propagation and Quality Codes in PCS 7
- Configuring Logic Blocks in the PCS 7 Advanced Process Library
- Optimizing CFC Execution Sequences and Runtime Groups
Related Tags
- CFC
- APL
- Data Blocks
- StruDiOu
- LogicDi