Chapter 8 Logic Instructions
8-143
FB/FC
FC
SEL is used for selecting one of two variables or constants and the
selected value is output to Out.
Parameters
Meaning
Description Valid range
G Gate Input
In0 is selected when G is
FALSE;
In1 is selected when G is
TRUE.
Depends on the data type of the
variable that the input parameter is
connected to.
In0 and In1 Selections Input Data to be selected
Depends on the data type of the
variable that the input parameter is
Out
Selection
result
Output Selection result
Depends on the data type of the
variable that the output parameter is
Boolean
Bit string Integer
Real
number
Time, date
String
BOOL
BYTE
WORD
LWORD
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
STRING
G
●
and
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Out
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●
Note:
The symbol ● indicates that the parameter is allowed to connect to the variable or constant of the data
type.
Function Explanation
According to the selection condition G, the SEL instruction selects one of two variables or
constants and the selection result is output to Out.
In0 INT#10:
In1 INT#20:
SEL
Out:INT#10
G=FALSE
In0 INT#10:
In1 INT#20:
SEL
Out:INT#20
G=TRUE