5-150
5.5 Standard Selection Functions
5.5.1 Selection
SEL(_E)
Operation Error
No operation error occurs in the execution of the SEL(_E) function.
Program Example
The program which selects either of values input to and according to the value input to ,
and outputs the operation result from in the same data type as that of and .
(a) Function without EN/ENO (SEL)
[Structured ladder]
[ST]
g_word3 := SEL (g_bool1, g_word1, g_word2);
(b) Function with EN/ENO (SEL_E)
[Structured ladder]
[ST]
g_bool3 := SEL_E (g_bool1, g_bool2, g_word1, g_word2, g_word3);
s2
s3 s1
d
s2
s3