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

MUX

Overview

IEC selection operator for multiplexing operation.

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

OUT := INk

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.

K has to be BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, LINT, ULINT or UDINT.

MUX selects the Kth value from among a group of values.

Example in IL

Result is 30

LD     0
MUX    30     ,
       40     ,
       50     ,
       60     ,
       70     ,
       80
ST     Var1

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 will all expressions be executed.