FB_BA_MUX_XX
Multiplexer function blocks exist for different variable types (BOOL, INT, LREAL, REAL, USINT, UINT, UDINT and DINT) and in different input values (4, 8, 12 and 16), but they all have the same functionality.
The function block FB_BA_MUX_LR16 is described as an example.
The function block FB_BA_MUX_XX outputs in the activated state (bEn=TRUE) that input value fIn01..fIn16 at output fQ whose number is entered at input nSel.
Example:
Inputs | Output |
---|---|
bEn = TRUE | fQ = 16.5 |
nSel = 5 |
|
fIn01 = 15.9 |
|
fIn02 = 32.5 |
|
fIn03 = 17.4 |
|
fIn04 = 5.84 |
|
fIn05 = 9.56 |
|
fIn06 = 16.5 |
|
fIn07 = 32,781 |
|
fIn08 = 25.4 |
|
fIn09 = 44.5 |
|
fIn10 = 66.1 |
|
fIn11 = 45.5 |
|
fIn12 = 83.3 |
|
fIn13 = 54.56 |
|
fIn14 = 33.8 |
|
fIn15 = 98.5 |
|
fIn16 = 71.3 |
|
If the entered value at nSel is greater than the number of inputs, the "highest" input is output at fQ:
Inputs | Output |
---|---|
bEn = TRUE | fQ = 2.3 |
nSel = 25 |
|
fIn01 = 15.9 |
|
fIn02 = 32.5 |
|
fIn03 = 17.4 |
|
fIn04 = 5.84 |
|
fIn05 = 9.56 |
|
fIn06 = 16.5 |
|
fIn07 = 32,781 |
|
fIn08 = 25.4 |
|
fIn09 = 44.5 |
|
fIn10 = 66.1 |
|
fIn11 = 45.5 |
|
fIn12 = 83.3 |
|
fIn13 = 54.56 |
|
fIn14 = 33.8 |
|
fIn15 = 98.5 |
|
fIn16 = 71.3 |
|
If bEn=FALSE, 0.0 is output at output fQ or FALSE for boolean multiplexers.
Inputs
VAR_INPUT
bEn : BOOL;
nSel : UDINT;
fIn01 : LREAL;
fIn02 : LREAL;
fIn03 : LREAL;
fIn04 : LREAL;
fIn05 : LREAL;
fIn06 : LREAL;
fIn07 : LREAL;
fIn08 : LREAL;
fIn09 : LREAL;
fIn10 : LREAL;
fIn11 : LREAL;
fIn12 : LREAL;
fIn13 : LREAL;
fIn14 : LREAL;
fIn15 : LREAL;
fIn16 : LREAL;
END_VAR
Name | Type | Description |
---|---|---|
bEn | BOOL | Activation of the block function |
nSel | UDINT | Number of the input, whose value is to be output at fQ. |
f01...f16 | LREAL | Input values to select from. |
Requirements
Development environment | Required PLC library |
---|---|
TwinCAT from v3.1.4024.22 | Tc3_BA2 from v5.2.5.0 |