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 values (4, 8, 12 and 16), but they all have the same functionality.
The function block FB_BA_DMUX_LR16 is described as an example.

The function block FB_BA_DMUX_XX outputs in the activated state (bEn= TRUE) the value at input fIn to the output fQ01..fQ16 whose number is entered at input nSel. All other outputs are set to 0 (for boolean demultiplexers to FALSE).

Example:

Inputs

Outputs

bEn = TRUE

fQ01 = 0.0

nSel = 5

fQ02 = 0.0

fIn = 32.5

fQ03 = 0.0

 

fQ04 = 0.0

 

fQ05 = 32.5

 

fQ06 = 0.0

 

fQ07 = 0.0

 

fQ08 = 0.0

 

fQ09 = 0.0

 

fQ10 = 0.0

 

fQ11 = 0.0

 

fQ12 = 0.0

 

fQ13 = 0.0

 

fQ14 = 0.0

 

fQ15 = 0.0

 

fQ16 = 0.0

If the value entered at nSel is greater than the number of outputs, the value of fIn is output at the "highest" output:

Inputs

Outputs

bEn = TRUE

fQ01 = 0.0

nSel = 25

fQ02 = 0.0

fIn = 32.5

fQ03 = 0.0

 

fQ04 = 0.0

 

fQ05 = 0.0

 

fQ06 = 0.0

 

fQ07 = 0.0

 

fQ08 = 0.0

 

fQ09 = 0.0

 

fQ10 = 0.0

 

fQ11 = 0.0

 

fQ12 = 0.0

 

fQ13 = 0.0

 

fQ14 = 0.0

 

fQ15 = 0.0

 

fQ16 = 32.5

If bEn = FALSE, 0.0 is output at all outputs, or FALSE for boolean demultiplexers.

FB_BA_DMUX_XX 2: Inputs

VAR_INPUT
  bEn     : BOOL;
  nSel    : UDINT;
  fIn     : LREAL;
END_VAR

Name

Type

Description

bEn

BOOL

Activation of the block function

nSel

UDINT

Number of the output fQ01...fQ16, which is to assume the value of input fIn.

fIn

LREAL

Value to be output.

FB_BA_DMUX_XX 3: Outputs

VAR_OUTPUT
  fQ01  : LREAL;
  fQ02  : LREAL;
  fQ03  : LREAL;
  fQ04  : LREAL;
  fQ05  : LREAL;
  fQ06  : LREAL;
  fQ07  : LREAL;
  fQ08  : LREAL;
  fQ09  : LREAL;
  fQ10  : LREAL;
  fQ11  : LREAL;
  fQ12  : LREAL;
  fQ13  : LREAL;
  fQ14  : LREAL;
  fQ15  : LREAL;
  fQ16  : LREAL;
END_VAR

Name

Type

Description

fQ01...fQ16

LREAL

Value outputs

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.22

Tc3_BA2 from v5.2.5.0