MUX

The IEC Operators and additional, norm-extending \ functions Multiplexer.

IN0, …,INn and OUT can be any type of variable. K must be BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT or UDINT. MUX selects the Kth value from among a group of values.

Example in IL:

LD 0
MUX 30,40,50,60,70,80
ST Var1 (* Result is 30 *)

Example in ST:

Var1:=MUX(0,30,40,50,60,70,80); (\* Result is 30 \*);

Note

An expression occurring ahead of an input other than INK will not be processed to save run time! Only in simulation mode all expressions will be executed.