DEMUX
DEMUX is a demultiplexer block. It decomposes one 16-bit word into 16 BOOL output variables.
Ladder Representation
Variable Table
| Variable Type | Name | Data Type | Description |
|---|---|---|---|
| VAR_INPUT | EN | BOOL | Enables block execution. |
| VAR_INPUT | Word | WORD UINT INT | 16-bit input variable. |
| VAR_OUTPUT | ENO | BOOL | Indicates the end of the operation. |
| VAR_OUTPUT | Bit0–Bit15 | BOOL | Bit value from the corresponding position of Word. |
Operation
When EN is TRUE, DEMUX decomposes Word into 16 Boolean values and stores them in Bit0 through Bit15.
Bit0 corresponds to the least significant bit (LSB). Bit15 corresponds to the most significant bit (MSB).
When EN is FALSE, the output variables remain 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 decomposes MYWORD into Boolean values and stores them in BIT0 through BIT15. The block finishes successfully and activates ENO.
The following Structured Text example applies the same demultiplexing logic.
Structured Text
VAR
MYWORD : WORD := 45985;
BIT0 : BOOL;
BIT1 : BOOL;
BIT2 : BOOL;
BIT3 : BOOL;
BIT4 : BOOL;
BIT5 : BOOL;
BIT6 : BOOL;
BIT7 : BOOL;
BIT8 : BOOL;
BIT9 : BOOL;
BIT10 : BOOL;
BIT11 : BOOL;
BIT12 : BOOL;
BIT13 : BOOL;
BIT14 : BOOL;
BIT15 : BOOL;
END_VAR
DO1 := FB_DEMUX(
EN:=DI1,
Word0:=MYWORD,
Bit0=>BIT0,
Bit1=>BIT1,
Bit2=>BIT2,
Bit3=>BIT3,
Bit4=>BIT4,
Bit5=>BIT5,
Bit6=>BIT6,
Bit7=>BIT7,
Bit8=>BIT8,
Bit9=>BIT9,
Bit10=>BIT10,
Bit11=>BIT11,
Bit12=>BIT12,
Bit13=>BIT13,
Bit14=>BIT14,
Bit15=>BIT15);