Learn PLCs free
Selection & LimitingBeginnerIEC 61131-3

SEL (Binary Selector)

Selects between two values based on a boolean condition: FALSE=IN0, TRUE=IN1.

The SEL (Select) function is a binary selector that chooses between two input values based on a boolean selector input. When G (selector) is FALSE, the output equals IN0. When G is TRUE, the output equals IN1. SEL is the IEC 61131-3 equivalent of a ternary operator or conditional expression. It is used for selecting between manual/auto values, choosing between two setpoints, implementing simple failover logic, and any two-way selection based on a condition.

Parameters

Inputs

NameTypeDescription
GBOOLSelector: FALSE selects IN0, TRUE selects IN1
IN0ANYValue selected when G is FALSE
IN1ANYValue selected when G is TRUE

Outputs

NameTypeDescription
OUTANYSelected value (IN0 or IN1)

Ladder Logic Example

// Ladder Logic - SEL (Manual/Auto Selection)
//
// |----[SEL]----|
// | G:   Auto_Mode       |
// | IN0: Manual_SP       |
// | IN1: Auto_SP         |
// | OUT: Active_SP       |

Structured Text Example

// Select between manual and auto setpoint
Active_SP := SEL(G := Auto_Mode, IN0 := Manual_SP, IN1 := Auto_SP);

// Equivalent to:
IF Auto_Mode THEN
    Active_SP := Auto_SP;
ELSE
    Active_SP := Manual_SP;
END_IF;

20 Production-Ready Ladder Logic Templates

Stop writing the same rungs from scratch. Get copy-paste-ready templates for motor control, PID loops, safety interlocks, conveyors, and more.

Platform-Specific Implementation

S

Siemens (TIA Portal)

Use SEL instruction in TIA Portal. Available in LAD, FBD, and SCL.

AB

Allen-Bradley (Studio 5000)

No direct SEL; implement with conditional moves or compute instruction.

C

CODESYS

Use SEL() function in ST. Part of standard IEC library.

Common Applications

  • Manual/auto mode switching
  • Dual setpoint selection
  • Failover value selection
  • Day/night mode parameters
  • Recipe value selection

Frequently Asked Questions

What is SEL (Binary Selector) in PLC programming?

Selects between two values based on a boolean condition: FALSE=IN0, TRUE=IN1. The SEL (Select) function is a binary selector that chooses between two input values based on a boolean selector input. When G (selector) is FALSE, the output equals IN0.

What are common applications of SEL (Binary Selector)?

SEL (Binary Selector) is commonly used for: Manual/auto mode switching, Dual setpoint selection, Failover value selection, Day/night mode parameters, Recipe value selection.

How do I use SEL (Binary Selector) in different PLC platforms?

Siemens: Use SEL instruction in TIA Portal. Available in LAD, FBD, and SCL. Allen-Bradley: No direct SEL; implement with conditional moves or compute instruction. CODESYS: Use SEL() function in ST. Part of standard IEC library.

Stop Writing Ladder Logic From Scratch

Get 20 production-ready ladder logic templates for $29 -- download instantly and use them on your next project today.

20
Ready-Made Templates
LD + ST
Both Languages Included
$29
One-Time Purchase
Get Instant Access -- $29

Instant download - 30-day money-back guarantee - Use on unlimited projects

Free PLC simulator

Wire this block up and run it

Drop the instruction into a rung, hit Run, and watch it execute in your browser. 12 guided lessons across 8 PLC dialects — free account, no credit card.

Practice PLCs free →