FB_BA_MUX_XX

Multiplexer blocks exist for different variable types (BOOL, INT, LREAL, REAL, USINT, UINT and UDINT) and in different input parameters (5, 9, 13 and 17), but they all have the same functionality.
The function block FB_BA_MUX_LR16 is described as an example.

FB_BA_MUX_XX 1:

Functional description

The function block outputs in the activated state (bEn=TRUE) that input value lrIn00..lrIn16 at output lrQ whose number is entered at input udiSel.

Example:

Inputs

Output

bEn = TRUE

lrQ = 16.5

udiSel = 5

 

lrIn00 = 15.9

 

lrIn01 = 32.5

 

lrIn02 = 17.4

 

lrIn03 = 5.84

 

lrIn04 = 9.56

 

lrIn05 = 16.5

 

lrIn06 = 32,781

 

lrIn07 = 25.4

 

lrIn08 = 44.5

 

lrIn09 = 66.1

 

lrIn10 = 45.5

 

lrIn11 = 83.3

 

lrIn12 = 54.56

 

lrIn13 = 33.8

 

lrIn14 = 98.5

 

lrIn15 = 71.3

 

lrIn16 = 2.3

 


If the entered value at udiSel is greater than the number of inputs, the "highest" input is output at lrQ:

Inputs

Output

bEn = TRUE

lrQ = 2.3

udiSel = 25

 

lrIn00 = 15.9

 

lrIn01 = 32.5

 

lrIn02 = 17.4

 

lrIn03 = 5.84

 

lrIn04 = 9.56

 

lrIn05 = 16.5

 

lrIn06 = 32,781

 

lrIn07 = 25.4

 

lrIn08 = 44.5

 

lrIn09 = 66.1

 

lrIn10 = 45.5

 

lrIn11 = 83.3

 

lrIn12 = 54.56

 

lrIn13 = 33.8

 

lrIn14 = 98.5

 

lrIn15 = 71.3

 

lrIn16 = 2.3

 

If bEn=FALSE, 0.0 is output at output lrQ or FALSE for boolean multiplexers.

Inputs/outputs

VAR_INPUT

bEn    : BOOL;
udiSel : UDINT;
lrIn00 : LREAL;
lrIn01 : LREAL;
lrIn02 : LREAL;
lrIn03 : LREAL;
lrIn04 : LREAL;
lrIn05 : LREAL;
lrIn06 : LREAL;
lrIn07 : LREAL;
lrIn08 : LREAL;
lrIn09 : LREAL;
lrIn10 : LREAL;
lrIn11 : LREAL;
lrIn12 : LREAL;
lrIn13 : LREAL;
lrIn14 : LREAL;
lrIn15 : LREAL;
lrIn16 : LREAL;

bEn: activation of the block function

udiSel: number of the input, whose value is to be output at lrQ.

lr00...lr16: input values to select from

VAR_OUTPUT

lrQ   : UDINT;

lrQ: value of the selected input

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