FB_BA_DMUX_XX
Demultiplexer blocks exist for different variable types (BOOL, INT, LREAL, REAL, USINT, UINT and UDINT) and in different output parameters (5, 9, 13 and 17), but they all have the same functionality.
The block FB_BA_DMUX_LR16 is described as an example.
Functional description
In the activated state (bEn=TRUE), the function block outputs the value at input lrIn to that output lrQ01..lrQ16 whose number is entered at input udiSel. All other outputs are set to 0 (for boolean demultiplexers to FALSE).
Example:
Inputs | Outputs |
---|---|
bEn = TRUE | lrQ00 = 0.0 |
udiSel = 5 | lrQ01 = 0.0 |
lrIn = 32.5 | lrQ02 = 0.0 |
| lrQ03 = 0.0 |
| lrQ04 = 0.0 |
| lrQ05 = 32.5 |
| lrQ06 = 0.0 |
| lrQ07 = 0.0 |
| lrQ08 = 0.0 |
| lrQ09 = 0.0 |
| lrQ10 = 0.0 |
| lrQ11 = 0.0 |
| lrQ12 = 0.0 |
| lrQ13 = 0.0 |
| lrQ14 = 0.0 |
| lrQ15 = 0.0 |
| lrQ16 = 0.0 |
If the value entered at udiSel is greater than the number of outputs, the value of lrIn is output at the "highest" output:
Inputs | Outputs |
---|---|
bEn = TRUE | lrQ00 = 0.0 |
udiSel = 25 | lrQ01 = 0.0 |
rIn = 32.5 | lrQ02 = 0.0 |
| lrQ03 = 0.0 |
| lrQ04 = 0.0 |
| lrQ05 = 0.0 |
| lrQ06 = 0.0 |
| lrQ07 = 0.0 |
| lrQ08 = 0.0 |
| lrQ09 = 0.0 |
| lrQ10 = 0.0 |
| lrQ11 = 0.0 |
| lrQ12 = 0.0 |
| lrQ13 = 0.0 |
| lrQ14 = 0.0 |
| lrQ15 = 0.0 |
| lrQ16 = 32.5 |
If bEn = FALSE, 0.0 is output at all outputs, or FALSE for boolean demultiplexers.
Inputs/outputs
VAR_INPUT
bEn : BOOL;
udiSel : UDINT;
lrIn : LREAL;
bEn: Activation of the block function.
udiSel: Number of the output (lrQ00...lrQ16), which is to take on the value of input lrIn.
lrIn: Value to be output.
VAR_OUTPUT
lrQ00 : LREAL;
lrQ01 : LREAL;
lrQ02 : LREAL;
lrQ03 : LREAL;
lrQ04 : LREAL;
lrQ05 : LREAL;
lrQ06 : LREAL;
lrQ07 : LREAL;
lrQ08 : LREAL;
lrQ09 : LREAL;
lrQ10 : LREAL;
lrQ11 : LREAL;
lrQ12 : LREAL;
lrQ13 : LREAL;
lrQ14 : LREAL;
lrQ15 : LREAL;
lrQ16 : LREAL;
lrQ00...lrQ16: value outputs.
Requirements
Development environment | Target system | required library | required supplement |
---|---|---|---|
TwinCAT 2.11 R3/x64 | PC/CX | TcBA library from V1.0.0 | TS8040 | TwinCAT Building Automation from V1.0.0 |