Select (SEL)

This information applies to the
CompactLogix
5370,
ControlLogix
5570,
Compact GuardLogix
5370,
GuardLogix
5570,
Compact GuardLogix
5380,
CompactLogix
5380,
CompactLogix
5480,
ControlLogix
5580, and
GuardLogix
5580 controllers.
The Select (SEL) instruction uses a digital input to select one of two inputs.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
SEL_FBD_avail_v31
Structured Text
This instruction is not available in structured text.
Operands
Function Block
Operand
Type
Format
Description
SEL tag
SELECT
structure
SEL structure
SELECT Structure
Input Parameter
Data Type
Description
EnableIn
BOOL
Enable input. If cleared, the instruction does not execute and outputs are not updated.
Default is set.
In1
REAL
The first analog signal input to the instruction.
Valid = any float
Default = 0.0
In2
REAL
The second analog signal input to the instruction.
Valid = any float
Default = 0.0
SelectorIn
BOOL
The input that selects between In1 and In2.
Default is cleared.
Output Parameter
Data Type
Description
EnableOut
BOOL
Indicates if instruction is enabled. Cleared on overflow.
Out
REAL
The calculated output of the algorithm.
Description
The SEL instruction operates as follows:
Condition
Action
SelectorIn is set
Out = In2
SelectorIn is cleared
Out = In1
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related faults.
Execution
Function Block
Condition/State
Action Taken
Prescan
EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is false
EnableIn and EnableOut bits are cleared to false.
Tag.EnableIn is true
EnableIn and EnableOut bits are set to true.
The instruction executes.
Instruction first run
N/A
Instruction first scan
Out n-1 is set to 0.
Postscan
N/A
Example
The SEL instruction selects In1 or In2 based on SelectorIn. If SelectorIn is set, the instruction sets Out = In2. If SelectorIn is cleared, the instruction sets Out = In1. Out becomes an input parameter for function_block_C.
Function Block
SEL_FBD_ex_v31
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.