FB_BA_FIFO08

Sequential control of up to eight aggregates

FB_BA_FIFO08 1:

Functional description

The function block FB_BA_FIFO08 enables sequential control of up to eight units, with automatic switching of the switch-on sequence based on operating hours.
The function block is available in two versions: for a sequence of four or eight units.

Units with fewer operating hours take precedence in the sequence over units with more operating hours.

A rising edge at bChg forces a sequence change. The units with the fewest operating hours are set to the top of the FIFO and thus given priority for switching on.
In the sequence only units are entered, which are enabled at inputs bEn01..bEn08. udiNum indicates the number of requested units.
The operating hours of the units are entered at inputs udiActvTi01 to udiActvTi08. If all these inputs are set to a constant value of zero, the sequence change is controlled cyclically, depending on bChg.
The first unit is removed from the FIFO, the other units are advanced, and the first unit is appended at the end of the FIFO again. As a result is an alternating sequence of units.
If more units are requested at input udiNum than are available at inputs bEn01 to bEn08, this is indicated with TRUE at bErr.

Error handling

If more units are requested at input udiNum than are available at inputs bEn01 to bEn08, this is indicated with TRUE at bErr.

Inputs/outputs

VAR_INPUT

bEn         : BOOL;
udiNum      : UDINT;
bChg        : BOOL;
bEn01       : BOOL;
bEn02       : BOOL;
bEn03       : BOOL;
bEn04       : BOOL;
bEn05       : BOOL;
bEn06       : BOOL;
bEn07       : BOOL;
bEn08       : BOOL;
udiActvTi01 : UDINT;
udiActvTi02 : UDINT;
udiActvTi03 : UDINT;
udiActvTi04 : UDINT;
udiActvTi05 : UDINT;
udiActvTi06 : UDINT;
udiActvTi07 : UDINT;
udiActvTi08 : UDINT;

bEn: enable of the function block

udiMyNum: number of aggregates

bChg: force sequence change

bEn01...bEn08: enable aggregate 1...enable aggregate 8

udiActvTi01...udiActvTi08: operating hours aggregate 1...operating hours aggregate 8

VAR_OUTPUT

bQ01        : BOOL;
bQ02        : BOOL;
bQ03        : BOOL;
bQ04        : BOOL;
bQ05        : BOOL;
bQ06        : BOOL;
bQ07        : BOOL;
bQ08        : BOOL;
udiNextOn   : UDINT;
udiNextOff  : UDINT;
arrFIFO     : ARRAY [1..8] OF UDINT;
udiNumOfEn  : UDINT;
bErr        : BOOL;
udiErrId    : UDINT;
udiErrArg   : UDINT;

bQ01...bQ08: switches aggregate 1…8

udiNextOn: number of the aggregate that is switched on next.

udiNextOff: number of the aggregate that is switched off next.

arrFIFO: FIFO buffer as a field

udiNumOfEn: number of devices, depending on the individual enable states

bErr: this output is switched to TRUE if the parameters entered are erroneous.

udiErrId / udiErrArg: contains the error number and the error argument. See error codes.

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