FB_BARFanCoil

FB_BARFanCoil 1:

Application

The function block maps a 3-speed fan with the corresponding switching hysteresis, which is the same for all three speeds. The speed is set stepwise via the control deviation of the actual room temperature value from the set room temperature value. Furthermore there is a possibility to manually override the fan controller via the iStageManual or bStageUp or bStageDown input. A minimum switch-on time can be set via the udiSecMINPowerOnTime input, which is then valid for each stage.

VAR_INPUT

eDataSecurityType            : E_HVACDataSecurityType;
bSetDefault                  : BOOL;
bEnable                      : BOOL;
eCtrlFct                     : E_BARCtrlFct;
rSetpoint                    : REAL;
rRoomTemp                    : REAL;
bStageUp                     : BOOL;
bStageDown                   : BOOL;
iStageManual                 : INT;
bReset                       : BOOL;

eDataSecurityType:if eDataSecurityType:= eHVACDataSecurityType_Persistent, the persistent VAR_IN_OUT variables of the function block are stored in the flash of the computer if a value changes. For this to work, the function block FB_HVACPersistentDataHandling must be instanced once in the main program, which is called cyclically. Otherwise the instanced FB is not released internally.

A change of value can be initiated by the building management system, a local operating device or via a write access from TwinCAT. When the computer is restarted, the saved data are automatically read back from the flash into the RAM.

If eDataSecurityType:= eHVACDataSecurityType_Idle the persistently declared variables are not saved in a fail-safe manner.

Notice

A cyclically changing variable must never be linked with the IN_OUT variable of a function block, if eDataSecurityType:= eHVACDataSecurityType_Persistent. It would lead to early wear of the flash memory.

bSetDefault: If the variable is TRUE, the default values of the VAR_IN_OUT variables are adopted.

bEnable: The function block is activated if the variable bEnable is TRUE. No fan stage is activated with a FALSE.

eCtrlFct: this input is connected to the eCtrlFct output of the FB_BARFctSelection. This information is important in order to know whether the plant is in heating or cooling mode. In automatic mode the fan stages are only activated, for example, if according to the control deviation the requirement for heating is active and the system is in heating mode, or if according to the control deviation the requirement for cooling is active and the system is in cooling mode.

rSetpoint: input for the set temperature.

rRoomTemp: input for the room temperature.

bStageUp: Local adjustment of the fan stage, stepwise increase by push button.

bStageDown: Local adjustment of the fan stage, stepwise decrease by push button.

iStageManual: The manual fan stage can/is set centrally via this input.
iStageManual: = 0 corresponds to fan stage OFF
iStageManual: = 1 corresponds to fan stage AUTO
iStageManual: = 2 corresponds to fan stage01 active
iStageManual: = 3, corresponds to fan stage02 active
iStageManual: = 4, corresponds to fan stage03 active

bReset: Acknowledge input in case of a fault or an incorrect parameter.

VAR_OUTPUT

bStageOff              : BOOL;
bStageAuto             : BOOL;
bStage01               : BOOL;
bStage02               : BOOL;
bStage03               : BOOL;
bFanCoilActive         : BOOL;
bPresence              : BOOL;
byState                : BYTE;    
byError                : BYTE;
udiSecRT_MINPowerOnTime: UDINT;
udiRT_TimePeriod       : UDINT;
bInvalidParameter      : BOOL;

bStageOff: TRUE, fan stages are switched off.

bStageAuto: TRUE, fan controller is in automatic mode.

bStage01: TRUE, fan stage01 active.

bStage02: TRUE, fan stage02 active.

bStage03: TRUE, fan stage03 active.

bFanCoilActive: TRUE if one of the three fan stages is active. This output can be/is used to enable controllers in order to avoid a build up of heat or cold.

bPresence: TRUE means that presence was detected via the bStageUp, bStageDown or iStageManual inputs.

byState: indicates the state of the fan controller.
byState.0:= function block is activated
byState.3:= manual fan stage setting is active
byState.4:= bReset
byState.5:= fan stage01 active
byState.6:= fan stage02 active
byState.7:= fan stage03 active

byError: output of the errors as byte.
byError.1:= bInvalidParameter

udiSecRT_MINPowerOnTime: Indicates the remaining time of the minimum switch-on time.

udiRT_TimePeriod: Indicates the remaining time of the manual override.

bInvalidParameter: Indicates that an incorrect input parameter is present. bInvalidParameter must be acknowledged with bReset.

VAR_IN_OUT

rDeviationXW_Stage01   : REAL;
rDeviationXW_Stage02   : REAL;
rDeviationXW_Stage03   : REAL;
rHysteresisRange       : REAL;
udiSecMINPowerOnTime   : UDINT;
iFctModeFanCoil        : INT;
udiTimePeriod          : UDINT;

rDeviationXW_Stage01: limit value of the control deviation for fan stage01. The variable is saved persistently. Preset to 0.7.

rDeviationXW_Stage02: limit value of the control deviation for fan stage02. The variable is saved persistently. Preset to 1.7.

rDeviationXW_Stage03: limit value of the control deviation for fan stage03. The variable is saved persistently. Preset to 2.1.

rHysteresisRange: hysteresis range that is placed around the limit value.
Example: a limit value of 0.7 and a hysteresis range of 0.2 results in the fan stage01 being switched on at a control deviation > 0.8.
And at a control deviation < 0.6 the fan stage01 is switched off.
The variable is saved persistently. Preset to 0.2.

udiSecMINPowerOnTime: Minimum switch-on time that a fan must run for in a stage before switching to a different stage or switching off. Input in seconds (e.g. 120 corresponds to 120 s). The variable is saved persistently. Preset to 120 s.

iFctModeFanCoil: The user has the possibility to activate the fan controller for heating mode or cooling mode or both modes via the valence of this variable. Valid values are 1, 2 or 3. Other values are invalid and bInvalidParameter is set to TRUE. The variable is saved persistently. Preset to 3%.

Cooling

Heating

Valence

0

1

1 (= fan controller active in heating mode)

1

0

2 (= fan controller active in cooling mode)

1

1

3 (= fan controller active in heating mode and cooling mode)

udiTimePeriod: Timeframe during which the manual override is active in case of presence. Specified in minutes

Fig. 1: representation of the fan control with the default parameters

FB_BARFanCoil 2: