EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers.

SEL

Overview

IEC selection operator for binary selection.

G determines whether IN0 or IN1 is assigned to OUT.

OUT := SEL(G, IN0, IN1) means:

OUT := IN0;             if G=FALSE

OUT := IN1;                  if G=TRUE

Allowed data types:

IN0, ...,INn and OUT can be any identical data type. Make sure that variables of the identical data type are used at these positions, especially when using user-defined data types. The compiler verifies the identity of the types and returns compiler errors. Assigning function block instances to interface variables is not supported.

G: BOOL

Example in IL

LD  TRUE
SEL 3,4   (* IN0 = 3, IN1 =4 *)
ST  Var1  (* result is 4 *)
LD  FALSE
SEL 3,4
ST  Var1  (* result is 3 *)

Example in ST

Var1:=SEL(TRUE,3,4); (* result is 4 *)

Example in FBD

G-SE-0024409.2.gif-high.gif

 

 

Note

NOTE: An expression occurring ahead of IN0 will not be processed if G is TRUE. An expression occurring ahead of IN1 will not be processed if G is FALSE.