FB_BARFanCoil

FB_BARFanCoil 1:

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.

Application example: example_persistent.zip

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 output eCtrlFct of 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 pushbutton.

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

iStageManual: The manual fan stage can be/is centrally adjusted via this input.
iStageManual: = 0, corresponds to the fan stage OFF
iStageManual: = 1, corresponds to the fan stage AUTO
iStageManual: = 2, corresponds to fan stage 01 active
iStageManual: = 3, corresponds to fan stage 02 active
iStageManual: = 4, corresponds to fan stage 03 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 stage 01 active.

bStage02: TRUE, fan stage 02 active.

bStage03: TRUE, fan stage 03 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 specification is active
byState.4:= bReset
byState.5 = fan stage 01 active
 byState.6 = fan stage 02 active
byState.7 = fan stage 03 active

byError: Output of the error as a 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 there is an incorrect input parameter. 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 stage 01. The variable is saved persistently. Preset to 0.7.

rDeviationXW_Stage02: Limit value of the control deviation for fan stage 02. The variable is saved persistently. Preset to 1.7.

rDeviationXW_Stage03: Limit value of the control deviation for fan stage 03. The variable is saved persistently. Preset to 2.1.

rHysteresisRange: Hysteresis range placed around the limit value.
Example: A limit value of 0.7 and a hysteresis range of 0.2 results in fan stage 01 being switched on at a control deviation of > 0.8.
At a control deviation of < 0.6 fan stage 01 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. The variable is saved persistently. Preset to 60 min.

Illustration of the fan control with the default parameters:

FB_BARFanCoil 2:

Requirements

Development environment

required library

required function

TwinCAT 3.1 build 4022.16 or higher

Tc2_HVAC V3.3.1.0

TF8000 | TC3 HVAC V1.0.0.0