FB_BA_DMUX_XX

FB_BA_DMUX_XX 1:

Demultiplexer function blocks exist for different variable types (BOOL, INT, LREAL, REAL, USINT, UINT, UDINT and DINT) and in different output parameters (4, 8, 12 and 16), but they all have the same functionality.
The function block FB_BA_DMUX_LR16 is described as an example.

In active state (bEn=TRUE), the function block outputs the value at input lrIn at the 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

lrQ01 = 0.0

udiSel = 5

lrQ02 = 0.0

lrIn = 32.5

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

lrQ01 = 0.0

udiSel = 25

lrQ02 = 0.0

rIn = 32.5

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.

VAR_INPUT

bEn     : BOOL;
udiSel  : UDINT;
rIn     : 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

Required PLC library

TwinCAT from v3.1.4024.7

Tc3_BA from v1.1.6.0