MUXPermalink

IEC operator: Multiplexer.

⮫ “Overview”

‎ OUT := MUX(K, IN0,...,INn) means:‎

‎ OUT := INK‎

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 ST:

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

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.