Understanding Boolean Multiplexing Logic and Control Inversion in CFC Block SEL_BO

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

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:

Control Input KData Input IN0Data Input IN1Output OUTSelected Active Input0 (FALSE)000IN10 (FALSE)011IN10 (FALSE)100IN10 (FALSE)111IN11 (TRUE)000IN01 (TRUE)010IN01 (TRUE)101IN01 (TRUE)111IN0

Logic Selection Block Comparison

The following table compares SEL_BO with alternative selection blocks in PCS 7:

Selection BlockLibrary FamilySupported Data TypesControl Input BehaviorSignal Status (ST) EvaluationSEL_BOElementary / StandardRaw BOOLK=1 selects IN0; K=0 selects IN1None (pure digital bit)SEL_RElementary / StandardRaw REALK=1 selects IN0; K=0 selects IN1None (pure float)SelModLAdvanced Process Library (APL)Structured BOOL / REALParameterized selection via mode codeFull NAMUR NE107 quality propagationMUX8_BOElementary / StandardRaw BOOL (8 Inputs)3-bit integer index (0 to 7)None

Step-by-Step Implementation Procedure

Method: Configuring SEL_BO for Dual Interlock Selection

  1. In SIMATIC Manager, open the target CFC chart.
  2. Open the CFC block catalog and navigate to Libraries > Elementary Blocks > Selection > SEL_BO.
  3. Drag SEL_BO into the chart sheet.
  4. Identify the selector condition (e.g., Auto_Mode_Active):
    - Connect the selector condition to pin K.
  5. Connect the signal that must be active when Auto_Mode_Active = 1 to pin IN0.
  6. Connect the alternate fallback signal (active when Auto_Mode_Active = 0) to pin IN1.
  7. Interconnect OUT to the target actuator command (e.g., VlvL.OpenAut).
  8. Compile the CFC chart with 'Changes Only' and download to the controller.

Verification

To verify SEL_BO execution:

  1. Switch CFC to online test mode (Debug > Test Mode).
  2. Observe pins K, IN0, IN1, and OUT dynamically.
  3. Force K = 0: Verify that toggling IN0 has no effect on OUT, while toggling IN1 directly alters OUT.
  4. Force K = 1: Verify that toggling IN1 has no effect on OUT, while toggling IN0 directly alters OUT.
  5. Confirm that the selected logic state agrees 100% with plant operating descriptions.

Limitations and Operational Precautions

  • Quality Code Blindness: SEL_BO does not evaluate signal status; if IN0 originates from a failed transmitter, SEL_BO passes 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 like F_SEL_BO which 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

Related Articles

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
6 respuestas