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
| Name | Type | Description |
|---|---|---|
| G | BOOL | Selector: FALSE selects IN0, TRUE selects IN1 |
| IN0 | ANY | Value selected when G is FALSE |
| IN1 | ANY | Value selected when G is TRUE |
Outputs
| Name | Type | Description |
|---|---|---|
| OUT | ANY | Selected 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
Siemens (TIA Portal)
Use SEL instruction in TIA Portal. Available in LAD, FBD, and SCL.
Allen-Bradley (Studio 5000)
No direct SEL; implement with conditional moves or compute instruction.
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.
Related Function Blocks
MUX (Multiplexer)
Selects one of N input values based on an integer selector index.
View Reference →MAX (Maximum Selection)
Returns the larger of two or more input values.
View Reference →MIN (Minimum Selection)
Returns the smaller of two or more input values.
View Reference →LIMIT (Limiter / Clamp)
Clamps a value between minimum and maximum boundaries.
View Reference →LIMIT (Value Limiter)
Constrains input value to specified minimum and maximum range.
View Reference →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.
Instant download - 30-day money-back guarantee - Use on unlimited projects