FB_BA_PlantControl

FB_BA_PlantControl 1:

The function block realizes the sequential start-up of a plant.

When starting, the aggregates are switched on one after the other in a specific order.

When switching off the plant, the aggregates are switched off in reverse order.

The steps of the start sequence and the profiles with the specific releases of individual aggregates result in a switching matrix.

Switching matrix

FB_BA_PlantControl 2:

The plant steps are shown in the column framed vertically in red.

The start sequence of the plant begins with the element [1] ERC, energy recovery. The element [2] PreHeater PreRinse, etc. follows.

The starting sequence of the aggregates is the same for all plant profiles.

The horizontal green framed area contains the descriptions of the plant profiles. The profiles can be used to command aggregates with regard to project-specific requirements. Each plant profile has its own step sequence within which the aggregates are commanded. The input variable nProfile determines the plant profile or the column in the control matrix.

The area highlighted in yellow contains the command for the ERC (energy recovery) aggregate for the Auto profile (normal operation). As this is the binary release of the aggregate, bValue = TRUE. Multi-stage aggregates can be commanded with the variable nValue and continuous aggregates with the variable fValue.

The blue framed field contains variables for parameterization of the start sequence. These parameters can be used to define different timers and conditions for switching the start sequence up and down for each profile.

In this sample, bEnFdbUp = TRUE. This means that feedback from the aggregate PreHeater is expected before the start sequence switches up and the next aggregate with the index [3] DmpOuA (outside air damper) switches on.

The start of the sequence is activated depending on the input variable bStart. A rising edge at bStart begins commanding the aggregate with the index [1] and continues with the start process until the highest level of switching sequences is reached.

In the picture, the start of the sequence in the Auto profile is illustrated with the green arrow and contains 8 switching sequences.

A falling edge at bStart triggers the shutdown of the start sequence in reverse order. This is shown in the picture by the red arrow.

If bStart becomes FALSE (falling edge) during the start process, the sequence runs down again from the currently active step to the complete shutdown of all aggregates.

This is shown in the picture by the red arrow.

Notice

Locking the aggregates

If a changeover is made from one profile to another during upward or downward travel, the commands for the new profiles are issued directly to the aggregates until the plant step nStep. The aggregates above the current sequence (> nStep) receive the following commands: bValue = FALSE, nValue = 0 and fValue = 0.0

Necessary interlocks regarding the switch-on and switch-off sequence are therefore not always guaranteed.

External interlocking of the aggregates must therefore be used to ensure that no critical switching states occur. Alternatively, the active operation mode can first be completely shut down in its sequence before switching to a new profile using nProfile.

Syntax

FUNCTION_BLOCK FB_BA_PlantCtrl
VAR_INPUT
  bStart                   : BOOL;
  nProfile                 : UDINT;
END_VAR
VAR_INPUT CONSTANT PERSISTENT
  arrStepDescription       : ARRAY [1..MAX(1,BA_Param.nMaxAggregate)] OF T_MaxString;
  arrProfileDescription    : ARRAY [1..MAX(1,BA_Param.nMaxProfile)] OF ST_BA_ProfielDescription;
  arrProfileParameter      : ARRAY [1..MAX(1,BA_Param.nMaxProfile),1..MAX(1,BA_Param.nMaxAggregate)] OF ST_BA_ProfileParameter;
END_VAR
VAR_OUTPUT
  nStep                 : UDINT;
  bUp                   : BOOL;
  bDown                 : BOOL;
  nRemTiUp              : UDINT;
  nRemTiDown            : UDINT;
END_VAR
VAR_IN_OUT
  arrAggregate          : ARRAY [1..MAX(1,BA_Param.nMaxAggregate)] OF ST_BA_Aggregate;
END_VAR

FB_BA_PlantControl 3: Inputs

Name

Type

Description

bStart

BOOL

A rising edge starts the sequence.

On a falling edge, the sequence is run down in reverse order.

nProfile

UDINT

The current, valid profile is transferred to the control matrix via the input.

FB_BA_PlantControl 4: Inputs CONSTANT PERSISTENT

Name

Type

Description

arrStepDescription

ARRAY [1..MAX(1,BA_Param.nMaxAggregate)] OF T_MaxString

The plain text of the plant steps is specified in the array. This information is purely for display purposes.

The red framed area in the switching matrix indicates this.

Initialization plain text plant steps, see sample 1.

arrProfileDescription

ARRAY [1..MAX(1,BA_Param.nMaxProfile)] OF ST_BA_ProfileDescription

The profiles of the control matrix are defined in the array.

The green framed area in the switching matrix indicates this.

Initialization of the profile description, see sample 2.

arrProfileParameter

ARRAY [1..MAX(1,BA_Param.nMaxProfile),1..MAX(1,BA_Param.nMaxAggregate)] OF ST_BA_ProfileParameter

The two-dimensional array contains all the parameters for commanding the aggregates and parameterization of the step sequences. Each element of the array contains the profile parameter structure.

In the switching matrix, the orange and blue framed area indicates a part of the array.

Initialization of the parameters for the Auto profile, see sample 3.

Samples

Sample 1: Initialization plain text plant steps

FB_BA_PlantControl 5:

Sample 2: Initialization of the profile description

FB_BA_PlantControl 6:

Sample 3: Initializing the parameters for the Auto profile

The first index of the array stands for the profile nProfile, the second for the step in the start sequence or for the aggregate.

FB_BA_PlantControl 7:

FB_BA_PlantControl 8: Outputs

Name

Type

Description

nStep

UDINT

The variable indicates which step the sequence is in.

nStep = 0 means that no aggregate of the step sequence control is active.

bUp

BOOL

Indicates that the sequence of the step sequence control is in the rising state.

bDown

BOOL

Indicates that the sequence of the step sequence control is in the falling state.

nRemTiUp

UDINT

Countdown switching to the next level [s].

nRemTiDown

UDINT

Countdown switching off the active level [s].

FB_BA_PlantControl 9: / FB_BA_PlantControl 10: Inputs Outputs

Name

Type

Description

arrAggregates

ST_BA_Aggregate

The array contains a bidirectional data and command structure for each aggregate.

The order of the aggregates in the switching matrix is determined by the connection order of the structures.

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.55

Tc3_BA2 from v5.3.19.0