30 SELECTION FUNCTIONS
30.1 Selecting a Value
1931
30
30 SELECTION FUNCTIONS
30.1 Selecting a Value
SEL(_E)
These functions output the selected input value.
■Description, type, data type
■Operation processing
• These functions output either the (s2) or (s3) input value, in the same data type as (s2) or (s3), from (d) according to the
value input to (s1).
• If the value input to (s1) is FALSE (=0), the (s2) input value is output from (d).
• If the value input to (s1) is TRUE (=1), the (s3) input value is output from (d).
Data type of (s2) and (s3): INT (Argument names (s2) and (s3) correspond to the bit value (0 or 1) of (s1).)
• Input a BOOL data type value to (s1).
• Input a BOOL, INT, DINT, WORD, DWORD, REAL, LREAL, STRING, TIME, structure, or array data type value to (s2) and
(s3).
Ladder, FBD/LD Structured text
[Without EN/ENO] [With EN/ENO] [Without EN/ENO]
d:=SEL(s1,s2,s3);
[With EN/ENO]
d:=SEL_E(EN,ENO,s1,s2,s3);
Argument Description Type Data type
EN Execution condition (TRUE: Executed, FALSE: Not executed) Input variable BOOL
s1 (G) Output condition (TRUE: s3 output, FALSE: s2 output) Input variable BOOL
s2 (IN0) Input Input variable ANY
s3 (IN1)
ENO Output status (TRUE: Normal, FALSE: Abnormal) Output variable BOOL
d Output Output variable ANY
RnCPU
RnENCPU
RnSFCPU RnSFCPURnPCPURnPCPU
(Standard) (Safety)
(Redundant)
(Process)
EN ENO
ds1
s2
s3
(s2), (s3)
(s1)
(d)
1234
5678
1234
FALSE
SEL_G
_IN0
_IN1
SEL
BOOL
INT
INT
INT