FB_BA_FIFO08
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 that are enabled at inputs bEn01..bEn08. udiNum indicates the number of requested units.
The operating hours of the units are entered at inputs udiActvTi01_h to udiActvTi08_h. 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.
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_h : UDINT;
udiActvTi02_h : UDINT;
udiActvTi03_h : UDINT;
udiActvTi04_h : UDINT;
udiActvTi05_h : UDINT;
udiActvTi06_h : UDINT;
udiActvTi07_h : UDINT;
udiActvTi08_h : UDINT;
bEn: Enables the function block.
udiNum: Number of units.
bChg: Force sequence change.
bEn01...bEn08: Enable unit 1...enable unit 8.
udiActvTi01_h...udiActvTi08_h: Operating hours unit 1...operating hours unit 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;
sErrDescr : STRING;
bQ01...bQ08: Switches unit 1..8.
udiNextOn: Number of the unit that is switched on next.
udiNextOff: Number of the unit that is switched on 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.
sErrDescr: Contains the error description.
Error description |
---|
01: Warning: More than 8 devices are entered at input udiNum. The number is limited to the number enabled at inputs bEn01..bEn08. |
Requirements
Development environment | Required PLC library |
---|---|
TwinCAT from v3.1.4024.7 | Tc3_BA from v1.1.6.0 |