Understanding Boolean Multiplexing Logic and Control Inversion in CFC Block SEL_BO
In SIMATIC PCS 7 Continuous Function Chart (CFC), the elementary selection block SEL_BO (FB77 / FC170) operates as a two-to-one Boolean multiplexer governed by control input K: when K = 1, output OUT forwards the Boolean value of input IN0; when K = 0, output OUT forwards the Boolean value of input IN1. Engineers frequently misinterpret this relationship by assuming K = 1 selects IN1. To prevent inversion errors in safety and interlocking logic, always wire the primary active signal to IN0 and the alternate/fallback signal to IN1, or use modern APL selection blocks like SelModL for structured signals.
Table of Contents
- Executive Summary
- Functional Mechanics and Boolean Selection Architecture
- Common Engineering Misconceptions and Inversion Pitfalls
- Truth Table and Logic State Evaluation
- Logic Selection Block Comparison
- Step-by-Step Implementation Procedure
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Executive Summary
Continuous Function Chart (CFC) programming in SIMATIC PCS 7 utilizes elementary mathematical and logical blocks from the Standard / Elementary library to route signals dynamically based on operating states. Among these, the Boolean selector block SEL_BO is widely used to switch control signals between automatic and manual overrides or alternate sensor contacts. However, because SEL_BO evaluates K = 1 to route input IN0 rather than IN1, engineers unfamiliar with classic STEP 7 multiplexer conventions frequently introduce inverted logic into critical interlocking circuits. This article details the exact logic behavior of SEL_BO, provides its complete truth table, and contrasts it with modern APL routing blocks.
Functional Mechanics and Boolean Selection Architecture
The SEL_BO block executes simple, deterministic multiplexing logic on every scan cycle of its calling OB:
- Inputs:
K(BOOL): Control / selection input.IN0(BOOL): Signal routed when control input is active (TRUE).IN1(BOOL): Signal routed when control input is inactive (FALSE).- Output:
OUT(BOOL): The selected Boolean output value (OUT = (K AND IN0) OR (NOT K AND IN1)).
Because SEL_BO processes elementary BOOL types without signal status bytes (ST), it executes in a fraction of a microsecond, making it ideal for tight control loops where structured APL overhead is unnecessary.
Common Engineering Misconceptions and Inversion Pitfalls
The primary source of confusion stems from human indexing habits: engineers intuitive expect index 1 (IN1) to correspond with Boolean 1 (TRUE), and index 0 (IN0) to correspond with Boolean 0 (FALSE).
In SEL_BO, the definition is inverted:
* If K = TRUE, IN0 is passed through.
* If K = FALSE, IN1 is passed through.
Wiring an emergency bypass switch to K while placing the bypass permissive on IN1 results in inverted behavior: the bypass will engage when the switch is open and deactivate when the switch is closed.
Truth Table and Logic State Evaluation
The following truth table illustrates all eight operating permutations of SEL_BO:
KIN0IN1OUT0 (FALSE)000IN10 (FALSE)011IN10 (FALSE)100IN10 (FALSE)111IN11 (TRUE)000IN01 (TRUE)010IN01 (TRUE)101IN01 (TRUE)111IN0Logic Selection Block Comparison
The following table compares SEL_BO with alternative selection blocks in PCS 7:
SEL_BOBOOLK=1 selects IN0; K=0 selects IN1SEL_RREALK=1 selects IN0; K=0 selects IN1SelModLBOOL / REALMUX8_BOBOOL (8 Inputs)0 to 7)Step-by-Step Implementation Procedure
Method: Configuring SEL_BO for Dual Interlock Selection
- In SIMATIC Manager, open the target CFC chart.
- Open the CFC block catalog and navigate to Libraries > Elementary Blocks > Selection > SEL_BO.
- Drag
SEL_BOinto the chart sheet. - Identify the selector condition (e.g.,
Auto_Mode_Active):
- Connect the selector condition to pinK. - Connect the signal that must be active when
Auto_Mode_Active = 1to pinIN0. - Connect the alternate fallback signal (active when
Auto_Mode_Active = 0) to pinIN1. - Interconnect
OUTto the target actuator command (e.g.,VlvL.OpenAut). - Compile the CFC chart with 'Changes Only' and download to the controller.
Verification
To verify SEL_BO execution:
- Switch CFC to online test mode (Debug > Test Mode).
- Observe pins
K,IN0,IN1, andOUTdynamically. - Force
K = 0: Verify that togglingIN0has no effect onOUT, while togglingIN1directly altersOUT. - Force
K = 1: Verify that togglingIN1has no effect onOUT, while togglingIN0directly altersOUT. - Confirm that the selected logic state agrees 100% with plant operating descriptions.
Limitations and Operational Precautions
- Quality Code Blindness:
SEL_BOdoes not evaluate signal status; ifIN0originates from a failed transmitter,SEL_BOpasses the bad value through without warning. - Safety Critical Applications: In fail-safe safety programs (S7 F Systems), never use standard
SEL_BO; use certified F-Library blocks likeF_SEL_BOwhich enforce fail-safe defaults upon diagnostic faults.
Engineer FAQ
Why did Siemens design SEL_BO to select IN0 when K = 1?
This convention originates from early DIN and IEC 61131 standard multiplexer specifications where control input K selects input 0 on assertion, preserved across decades for backwards compatibility.
Can SEL_BO be used to invert a Boolean signal?
Yes, by connecting the signal to K, fixing IN0 = 0, and fixing IN1 = 1, output OUT produces the inverted NOT value of K.
What block should be used if I need to select between two structured APL signals?
Use SelModL from the PCS 7 Advanced Process Library; it routes both the value and the signal status byte, ensuring downstream blocks recognize degraded quality.
Technical References
- Siemens AG: SIMATIC Process Control System PCS 7 CFC for S7 / PCS 7 Manual (Doc No. A5E03415129)
- Siemens Industry Online Support Entry ID 109760968: SIMATIC PCS 7 Advanced Process Library (APL) Manual
- IEC 61131-3: Programmable Controllers - Part 3: Programming Languages
Related Articles
- https://industrialautomation.net/search?query=pcs7+cfc+sel_bo+block+logic
- https://industrialautomation.net/search?query=boolean+multiplexer+k+in0+in1
- https://industrialautomation.net/search?query=apl+selmodl+structured+selection
Related Tags
- https://industrialautomation.net/search?query=simatic-pcs7
- https://industrialautomation.net/search?query=cfc-editor
- https://industrialautomation.net/search?query=boolean-logic
- https://industrialautomation.net/search?query=elementary-blocks