BD11_DIGITAL_DEMULTIPLEXER
PROGRAM BD11_TEST
VAR
INPUT:REAL;
SELECTOR:LINT;
IN1: BOOL;
OUT1: LIB.CORE.V1_0.MULTIIOBOOL;
FB: LIB.CORE.V1_0.BD11_DIGITAL_DEMULTIPLEXER;
END_VAR
FB(IN:=IN1, SEL:=SELECTOR);
OUT1:=FB.OUT;
END_PROGRAM
LIB\CORE
V1.0
The block is a logical values demultiplexer. If SEL=1 then the first element of the output array OUT is a copy of the input IN. If SEL=2 then the second element of the output array is a copy of IN, etc. All other outputs are set to DEFAULT.
Input | Type | Description | Default value |
---|---|---|---|
IN | BOOL | Input value | False |
SEL | LINT | Output selector | 0 |
DEFAULT | BOOL | Default value of all outputs | False |
Output | Type | Description |
---|---|---|
OUT | MULTIIOBOOL | Output signal |
In the example above, output 3 is selected, displaying the value of True (1) which is brought on the input. All other outputs are False (0) which is the DEFAULT value.