FB_BA_PrioSwi_XX

The priority switches exist for different variable types (BOOL, INT, LREAL, REAL, USINT, UINT and UDINT) and in different output sizes (4, 8, 12, 16 and 24), but they all have the same functionality.
The block FB_BA_PrioSwi_LR08 is described as an example.

FB_BA_PrioSwi_XX 1:

Functional description

Priority switches are available for selecting different values. At output lrVal the value with the highest priority is applied whose input bEnxx is TRUE.

Example:

Inputs

Outputs

bEn01

FALSE

 

bQ

TRUE

 

lrVal01

 

32.5

lrVal

 

5.84

bEn02

FALSE

 

udiActvPrio

 

3

lrVal02

 

17.4

 

 

 

bEn03

TRUE

 

 

 

 

lrVal03

 

5.84

 

 

 

bEn04

TRUE

 

 

 

 

lrVal04

 

9.56

 

 

 

bEn05

FALSE

 

 

 

 

lrVal05

 

16.5

 

 

 

bEn06

TRUE

 

 

 

 

lrVal06

 

32.781

 

 

 

bEn07

FALSE

 

 

 

 

lrVal07

 

25.4

 

 

 

bEn08

TRUE

 

 

 

 

lrVal08

 

44.5

 

 

 


If none of the priorities is enabled, the output bQ switches to FALSE. 0 is output at lrVal and udiActvPrio. For a boolean priority switch, FALSE is then output at bVal.

Inputs

Outputs

bEn01

FALSE

 

bQ

FALSE

 

lrVal01

 

32.5

lrVal

 

0.0

bEn02

FALSE

 

udiActvPrio

 

0

lrVal02

 

17.4

 

 

 

bEn03

FALSE

 

 

 

 

lrVal03

 

5.84

 

 

 

bEn04

FALSE

 

 

 

 

lrVal04

 

9.56

 

 

 

bEn05

FALSE

 

 

 

 

lrVal05

 

16.5

 

 

 

bEn06

FALSE

 

 

 

 

lrVal06

 

32.781

 

 

 

bEn07

FALSE

 

 

 

 

lrVal07

 

25.4

 

 

 

bEn08

FALSE

 

 

 

 

lrVal08

 

44.5

 

 

 

Inputs/outputs

VAR_INPUT

bEn01   : BOOL;
lrVal01 : LREAL;
bEn02   : BOOL;
lrVal02 : LREAL;
bEn03   : BOOL;
lrVal03 : LREAL;
bEn04   : BOOL;
lrVal04 : LREAL;
bEn05   : BOOL;
lrVal05 : LREAL;
bEn06   : BOOL;
lrVal06 : LREAL;
bEn07   : BOOL;
lrVal07 : LREAL;
bEn08   : BOOL;
lrVal08 : LREAL;

bEn01...bEn08: enable of the priority value.

lrVal01...lrVal08: priority value.

VAR_OUTPUT

bQ          : BOOL;
lrVal       : LREAL;
udiActvPrio : UDINT;

bQ: output to indicate whether a priority is enabled.

lrVal: output of the value of the current (highest) priority that is enabled.

udiActvPrio: current (highest) priority that is enabled.

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