FB_BA_FnctSel

FB_BA_FnctSel 1:

The function block is used for enabling heating or cooling mode in a room.
The distribution network type plays a significant role:
In a two-pipe system, all rooms served by the plant can either be heated or cooled at the same time.
In a four-pipe system, the room conditioning can be demand-based, i.e. some rooms can be heated, while other rooms can be cooled by the same plant.

The function block used for each room, as already mentioned, selects its controllers, depending on which type of piping system is available:

Two-pipe network

The two-pipe system is selected if the function block has a FALSE entry at input bPipeSys. Since all rooms served by the plant can only either be heated or cooled, the choice is specified centrally for all rooms via the input bMedium. If bMedium is FALSE, the room heating controller is selected. If the input is TRUE the cooling controller is selected. The controller enable states bEnHtg and bEnCol are always issued with a delay of udiChgOvrDly_sec [s]. In other words, heating cannot be enabled until the cooling enable state bEnCol for udiChgOvrDly_sec is FALSE, and vice versa. In addition to the elapsing of this changeover time, the system checks that the output from controller to be switched off is 0.0. This is based on feedback at the inputs rCtrlValHtg and rCtrlValCol. In this way, a drastic change from heating to cooling and vice versa is avoided.

Four-pipe network

The four-pipe system is selected if the function block has a TRUE entry at input bPipeSys. In this case, the choice of controller can be different for the individual rooms as required, based on the room temperature rRmT and the setpoints rSpHtg for heating and rSpCol for cooling. If the room temperature exceeds the cooling setpoint, the cooling controller is activated (bEnCol), if it falls below the heating setpoint, the heating controller is activated (bEnHtg). If the temperature is between the two setpoints, both controllers are switched off (energy-neutral zone). Here too, the output of the controller enable states bEnHtg and bEnCol is delayed by udiChgOvrDly_sec [s] (see two-pipe network). In addition to the elapsing of this changeover time, the system checks that the output from controller to be switched off is 0.0. This is based on feedback at the inputs rCtrlValHtg and rCtrlValCol. In this way, a drastic change from heating to cooling and vice versa is avoided, if the changeover time is inadequate.

Dew-point monitor (bDewPnt)

In both systems (two- and four-pipe) the dew-point monitor has the task of deactivating cooling immediately, if required.

Program sequence

The function block can have 3 possible states:

  1. Waiting for heating or cooling enable
  2. Heating enable
  3. Cooling enable

In the first step, the function block waits for compliance with the conditions required for heating or cooling:

Heating

Cooling

Cooling controller output = 0 (rCtrlValCol)

Heating controller output = 0 (rCtrlValHtg)

Room temperature (rRmT) < heating setpoint (rSpHtg)

Room temperature (rRmT) > cooling setpoint (rSpCol)

Cooling controller enable (bEnCol) is FALSE over at least the changeover time udiChgOvrDly_sec [s]

Heating controller enable (bEnHtg) is FALSE over at least the changeover time udiChgOvrDly_sec [s]

Four-pipe system is selected (bPipesys=TRUE)
OR two-pipe system is selected and heating medium is available (bPipeSys=FALSE AND bMedium=FALSE)

Four-pipe system is selected (bPipesys=TRUE)
OR two-pipe system is selected and cooling medium is available (bPipeSys=FALSE AND bMedium=TRUE)

 

The dew-point monitor does not respond (bDewPnt=TRUE)

If a chain of conditions is met, the function block switches to the respective state (heating or cooling) and remains in this state until the corresponding controller issues 0 at the function block input (rCtrlValHtg/rCtrlValCol). This ensures that only one controller is active at any one time, even if a high heating controller output, for example, would call for a brief cooling intervention (overshoot). Heating or cooling continues until there is no longer a demand.

There are 3 exceptions, for which heating or cooling is immediately interrupted:

  1. A two-pipe system (bPipeSys=FALSE) is in heating mode (bEnHtg), but a switch to cooling medium occurred bMedium=TRUE
  2. A two-pipe system (bPipeSys=FALSE) is in cooling mode (bEnCol), but a switch to heating medium occurred bMedium=FALSE
  3. The dew-point monitor was triggered (bDewPnt=TRUE) in cooling mode (two- or four-pipe system)

In these cases the heating or cooling enable states are canceled, and the plant switches to standby.

Demand message (udireqdMedium)

To notify the plant of the current demand for heating or cooling, a demand ID is issued at the function block output, i.e. for each room, depending on the actual and set temperature. These can be collected and evaluated centrally. The evaluation always takes place, irrespective of the network type (two- or four-pipe).

udiReqdMedium

Medium

Room temperature

1

No medium is requested

rRmT > rSpHtg AND rRmT < rSpCol

2

Heating medium is requested

rRmT < rSpHtg

3

Cooling medium is requested

rRmT > rSpCol

Error handling

The heating setpoint must not be greater than or equal to the cooling setpoint, since this would result in temperature range with simultaneous heating and cooling demand. However, since the function block only issues one enable state at a time (i.e. heating or cooling), the case is harmless from a plant engineering perspective. In this case only a warning message is issued (bErr=TRUE, sErrDescr=warning message); the function block does not interrupt its cycle.

VAR_INPUT

bPipeSys          : BOOL;
bMedium           : BOOL;
bDewPnt           : BOOL;
rRmT              : REAL;
rSpHtg            : REAL;
rSpCol            : REAL;
rCtrlValHtg       : REAL;
rCtrlValCol       : REAL;
udiChgOvrDel_sec  : UDINT;

bPipeSys: In two-pipe system bPipeSys is FALSE, in four-pipe systems it is TRUE.

bMedium: Current supply of the whole two-pipe network with cooling or heating medium. If heating medium is active, bMedium is FALSE.

bDewPnt: Dew-point monitor: If bDewPnt = FALSE, the cooling controller is locked.

rTRm: Room temperature.

rSpHtg: Heating setpoint.

rSpCol: Cooling setpoint.

rCtrlValHtg: Current output value of the heating controller. Used internally as switching criterion from heating to cooling: rCtrlValHtg must be 0.

rCtrlValCol: Current output value of the cooling controller. Used internally as switching criterion from cooling to heating: rCtrlValCol must be 0.

udiChgOvrDel_sec: Switchover delay [s] from heating to cooling or vice versa. Internally limited to a minimum value of 0.

VAR_OUTPUT

bEnHtg                   : BOOL;
bEnCol                   : BOOL;
udiReqdMedium            : UDINT;
udiRemTiChgOvrDlyHtg_sec : UDINT;
udiRemTiChgOvrDlyCol_sec : UDINT;
bErr                     : BOOL;
sErrDescr                : T_MAXSTRING;

bEnHtg: Heating controller enable.

bEnCol: Cooling controller enable.

udiReqdMedium:

udiReqdMedium

Medium

Room temperature

1

No medium is requested

rRmT > rSpHtg AND rRmT < rSpCol

2

Heating medium is requested

rRmT < rSpHtg

3

Cooling medium is requested

rRmT > rSpCol

udiRemTiChgOvrDlyHtg_sec: Countdown [s] for switchover delay from cooling to heating.

udiRemTiChgOvrDlyCol_sec: Countdown [s] for switchover delay from heating to cooling.

bErr: In case of a fault, e.g. if warning stages are active, this output is set to TRUE.

sErrDescr: Contains the error description.

Error description

01: Warning: The heating setpoint is higher than or equal to the cooling setpoint

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.7

Tc3_BA from v1.1.6.0