FB_BA_FIFO08

FB_BA_FIFO08 1:

The function block FB_BA_FIFO08 enables a sequence control of up to eight aggregates with automatic change of the switch-on sequence according to operating hours.
The function block is available in two versions: for a sequence of four and of eight aggregates.

Aggregates 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 aggregates with the lowest operating hours are set to the front in the FIFO and thus switched on with priority.
In the following, only aggregates are entered which are enabled at the inputs bEn01...bEn08. nNum specifies the number of requested aggregates.
The operating hours of the aggregates are entered at the inputs nActvTi01 to nActvTi08. If these inputs are all constantly set to zero, the sequence change is only cyclically controlled depending on bChg.
In this case, the first aggregate always falls out of the FIFO, the others are moved forwards, and the first aggregate is attached again at the end of the FIFO. As a result is an alternating sequence of aggregates.

FB_BA_FIFO08 2: Inputs

VAR_INPUT
  bEn           : BOOL;
  nNum          : UDINT;
  bChg          : BOOL;
  bEn01         : BOOL;
  bEn02         : BOOL;
  bEn03         : BOOL;
  bEn04         : BOOL;
  bEn05         : BOOL;
  bEn06         : BOOL;
  bEn07         : BOOL;
  bEn08         : BOOL;
  nActvTi01     : UDINT;
  nActvTi02     : UDINT;
  nActvTi03     : UDINT;
  nActvTi04     : UDINT;
  nActvTi05     : UDINT;
  nActvTi06     : UDINT;
  nActvTi07     : UDINT;
  nActvTi08     : UDINT;
EN_VAR

Name

Type

Description

bEn

BOOL

Function block enable

nNum

UDINT

Number of aggregates

bChg

BOOL

Force sequence change

bEn01...bEn08

BOOL

Enable aggregate 1...enable aggregate 8.

nActvTi01...nActvTi08

UDINT

Operating hours aggregate 1...operating hours aggregate 8.

FB_BA_FIFO08 3: Outputs

VAR_OUTPUT
  bQ01        : BOOL;
  bQ02        : BOOL;
  bQ03        : BOOL;
  bQ04        : BOOL;
  bQ05        : BOOL;
  bQ06        : BOOL;
  bQ07        : BOOL;
  bQ08        : BOOL;
  nNextOn     : UDINT;
  nNextOff    : UDINT;
  aFIFO       : ARRAY [1..8] OF UDINT;
  nNumOfEn    : UDINT;
END_VAR

Name

Type

Description

bQ01...bQ08

BOOL

Switches aggregate 1...8.

nNextOn

UDINT

Number of the aggregate that is switched on next.

nNextOff

UDINT

Number of the aggregate which will be switched off next.

aFIFO

ARRAY OF UDINT

FIFO buffer as a field.

nNumOfEn

UDINT

Number of devices, depending on the individual enable states.

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.22

Tc3_BA2 from v5.2.5.0