MUX
MUX is a multiplexer block. It concatenates 16 BOOL input variables into one WORD output value.
Ladder Representation
Variable Table
| Variable Type | Name | Data Type | Description |
|---|---|---|---|
| VAR_INPUT | EN | BOOL | Enables block execution. |
| VAR_INPUT | Bit0–Bit15 | BOOL | Bit value for the corresponding position in the new word. |
| VAR_OUTPUT | ENO | BOOL | Indicates the end of the operation. |
| VAR_OUTPUT | Word | WORD UINT INT | New word formed from the input bits. |
Operation
When EN is TRUE, MUX concatenates the Boolean input values and stores the result in Word.
Bit0 corresponds to the least significant bit (LSB). Bit15 corresponds to the most significant bit (MSB).
When EN is FALSE, Word remains unchanged.
ENO passes the EN value to the next Ladder block after the operation finishes.
Execution Flowchart

Examples
- Ladder Example
- Structured Text Example
The example concatenates the Boolean input bits into the output word stored in MYWORD. The block finishes successfully and activates ENO.
The following Structured Text example applies the same multiplexing logic.
Structured Text
VAR
MYWORD : WORD;
END_VAR
MYWORD := FB_MUX(
EN:=DI1,
Bit0:=DI2,
Bit1:=DI3,
Bit2:=DI2,
Bit3:=DI2,
Bit4:=DI2,
Bit5:=DI2,
Bit6:=DI3,
Bit7:=DI3,
Bit8:=DI3,
Bit9:=DI2,
Bit10:=DI3,
Bit11:=DI2,
Bit12:=DI3,
Bit13:=DI3,
Bit14:=DI3,
Bit15:=DI2,
ENO=>DO1);