SELPermalink

IEC operator: Binary selection.

⮫ “Overview”

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

‎OUT := IN0 if G=FALSE;‎

‎OUT := IN1 if G=TRUE‎

IN0, IN1 and OUT can be any type of variable, G must be BOOL. The result of the selection is IN0 if G is FALSE, IN1 if G is TRUE.

Example in ST:

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

Example in FBD:

sel

An expression occurring ahead of IN1 or IN2 will not be processed if IN0 is TRUE.