FB_HVACCirculationPumpEx

FB_HVACCirculationPumpEx 1:

This function block serves to control pumps in HVAC systems.

The following switch-on conditions must first be fulfilled in order to control the pump via bPump:

bEnable = TRUE AND bErrorPumpProtec = FALSE AND bManSwitch = TRUE AND bCtrlVoltage = TRUE

If one of the switch-on conditions is not fulfilled, then the output bPump is constantly FALSE.

On the basis of the following diagrams it can be seen how the output bPump is controlled depending on the Enum eReqPump, the input bExternal, the outside temperature rOutSideTemp and the valve position rValvePosition. The switch-on conditions mentioned above must be fulfilled for this, and one of the two operation modes eHVACActuatorMode_Auto_BMS or eHVACActuatorMode_Auto_OP must be preselected.

FB_HVACCirculationPumpEx 2:

FB_HVACCirculationPumpEx 3: FB_HVACCirculationPumpEx 4: FB_HVACCirculationPumpEx 5:

FB_HVACCirculationPumpEx 6: FB_HVACCirculationPumpEx 7:

FB_HVACCirculationPumpEx 8: FB_HVACCirculationPumpEx 9:

eHVACReqPump_No: There is no request on the part of the Enum to control the pump (see E_HVACReqPump).

eHVACReqPump_OT_LL: The outside temperature (OT = rOutsideTemp) must be lower than rOutsideTempLowLimit (LL = Lower Limit) (see E_HVACReqPump).

eHVACReqPump_OT_HL: The outside temperature (OT = rOutsideTemp) must be higher than rOutsideTempHighLimit (HL = Higher Limit) (see E_HVACReqPump).

eHVACReqPump_VP: The valve position (VP = rValvePosition) must be larger than rValvePositionLimitOn (see E_HVACReqPump).

eHVACReqPump_OT_LL_OR_VP: The outside temperature (OT = rOutsideTemp) must be lower than rOutsideTempLowLimit (LL = Lower Limit) OR the valve position (VP = rValvePosition) must be larger than rValvePositionLimitOn (see E_HVACReqPump).

eHVACReqPump_OT_HL_OR_VP: The outside temperature (OT = rOutsideTemp) must be higher than rOutsideTempHighLimit (HL = Higher Limit) OR the valve position (VP = rValvePosition) must be larger than rValvePositionLimitOn (see E_HVACReqPump).

eHVACReqPump_OT_LL_AND_VP: The outside temperature (OT = rOutsideTemp) must be lower than rOutsideTempLowLimit (LL = Lower Limit) AND the valve position (VP = rValvePosition) must be larger than rValvePositionLimitOn (see E_HVACReqPump).

eHVACReqPump_OT_HL_AND_VP: The outside temperature (OT = rOutsideTemp) must be higher than rOutsideTempHighLimit (HL = Higher Limit) AND the valve position (VP = rValvePosition) must be larger than rValvePositionLimitOn (see E_HVACReqPump).

The output bPump switches itself off, after the switch-on conditions are no longer fulfilled, depending on the Enum eReqPump, the input bExternal, the outside temperature rOutSideTemp or the valve position rValvePosition, with a delay set by the time udiSecStopDelay.

FB_HVACCirculationPumpEx 10:

bError goes TRUE if bErrorPumpProtec is TRUE. However, only the fault bErrorPumpProtec leads to the deactivation of the output bPump. If the error message bErrorFeedb is also to lead to the switch-off of the pump, then the variable must be ANDed with the output bPump after calling the function block. The error message bErrorFeedb is active only in the operation mode eHVACActuatorMode_Auto_BMS OR eHVACActuatorMode_Auto_OP and only if the time udiSecFeedbPumpDelay is greater than 0. FB_HVACCirculationPumpEx 11:

Example for AntiBlocking function

FB_HVACCirculationPumpEx 12:

VAR_INPUT

eDataSecurityType : E_HVACDataSecurityType;
bSetDefault       : BOOL;
bEnable           : BOOL;
bExternal         : BOOL;
eCtrlModeActuator : E_HVACActuatorMode;
rOutsideTemp      : REAL;
rValvePosition    : REAL;
bFeedbPump        : BOOL;
bPumpProtec       : BOOL;
bManSwitch        : BOOL;
bCtrlVoltage      : BOOL;
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 enabled if bEnable = TRUE. If bEnable = FALSE, then the output bPump is constantly FALSE.

bExternal: The output bPump can be switched on or off directly via the input bExternal. The following conditions must be fulfilled for this:
bEnable = TRUE AND bErrorPumpProtec = FALSE AND bManSwitch = TRUE AND bCtrlVoltage = TRUE AND eCtrlModeActuator = eHVACActuatorMode_Auto_BMS OR eHVACActuatorMode_Auto_OP AND eReqPump=eHVACRequestPump_NoRequest.
Otherwise, bExternal controls the output bPump depending on bReqOutsideTemp and bReqValve, see diagrams above.
bExternal
is active only in the operation mode eHVACActuatorMode_Auto_BMS OR eHVACActuatorMode_Auto_OP.

eCtrlModeActuator: Enum that specifies the operation mode. The following operation modes are supported by the function block FB_HVACCirculationPumpEx: eHVACActuatorMode_Auto_BMS, eHVACActuatorMode_Auto_OP, eHVACActuatorMode_Speed1_BMS, eHVACActuatorMode_Speed1_OP, eHVACActuatorMode_Off_BMS, eHVACActuatorMode_Off_OP.
The two operation modes eHVACActuatorMode_Auto_BMS and eHVACActuatorMode_Auto_OP mean that the function block is in automatic mode.
The output bPump can be switched on directly via the two operation modes eHVACActuatorMode_Speed1_BMS and eHVACActuatorMode_Speed1_OP, provided the following conditions are fulfilled: bEnable = TRUE AND bErrorPumpProtec = FALSE AND bManSwitch = TRUE AND bCtrlVoltage = TRUE
The operation modes eHVACActuatorMode_Off_BMS and eHVACActuatorMode_Off_OP switch the output bPump to the FALSE state.
If an incorrect variable value is present on eCtrlModeActuator, the last valid variable value is taken. The state of the enum eCtrlModeActuator is output via eStateModeActuator (see E_HVACActuatorMode).

rOutsideTemp: Input for transmitting the outside temperature value. Depending on the outside temperature, the pump can be switched on if the temperature falls below the limit value rOutsideTempLowLimit or exceeds the limit value rOutsideTempHighLimit. This depends on the enum eReqPump for requesting the pump, see diagrams above.
rOutsideTemp
is active only in the operation mode eHVACActuatorMode_Auto_BMS OR eHVACActuatorMode_Auto_OP.

rValvePosition: Input for transmitting the valve position of the control loop. Depending on the position rValvePosition of the valve associated with the pump, the pump can be switched on when the threshold value rValvePositionLimitOn is exceeded. This depends on the enum eReqPump for requesting the pump, see diagrams above.
rValvePosition
is active only in the operation mode eHVACActuatorMode_Auto_BMS OR eHVACActuatorMode_Auto_OP.

bFeedbPump: Feedback from the pump or a relay contact that the pump is switched on. If the output bPump = TRUE, then the input bFeedbPump must be TRUE within the time specification udiSecFeedbPumpDelay and must remain so until bPump = FALSE. This error is otherwise indicated via the output variable bErrorFeedb. After the rectification of the fault it must be acknowledged at the input bReset. The error message bErrorFeedb has no effect on the control of the output bPump.
bFeedbPump is active only in the operation mode eHVACActuatorMode_Auto_BMS OR eHVACActuatorMode_Auto_OP and only if the time udiSecFeedbPumpDelay is greater than 0.
If no pump status feedback is present, but the functions are nevertheless realized, then a TRUE may not be applied constantly to the input bFeedbPump. This would lead in the switched-off state to an error: bErrorFeedb = TRUE. In this case the output bPump should be applied to the input bFeedbPump.

bPumpProtec: The motor protection switch for the pump is connected to the input bPumpProtec. A pump error has occurred if the input bPumpProtec is FALSE. If there is an error the output bPump goes FALSE and the error is displayed by means of the variable bErrorPumpProtec. The output bPump can only be switched on if bPumpProtec = TRUE (quiescent current principle). After the rectification of the fault it must be acknowledged at the input bReset.

bManSwitch: If the pump has a manual / emergency switch, this can be connected to the input bManSwitch. The state of the manual / emergency switch is monitored. The output bPump is disabled if bManSwitch= FALSE. The output bPump can only be switched on if bManSwitch = TRUE (quiescent current principle). The state of bManSwitch is indicated by the output variable bStateManSwitch.

bCtrlVoltage: The control voltage monitoring is applied to the input bCtrlVoltage. If bCtrlVoltage = FALSE, then the output bPump is constantly FALSE. In order to suppress error message torrents, the error messages bPumpProtec, bErrorFeedb and bError are registered only if the input bCtrlVoltage is TRUE.

bReset: Acknowledgment input in the case of a fault following its rectification.

VAR_OUTPUT

bPump                   : BOOL;
byState                 : BYTE;
bReqExternal            : BOOL;
bReqOutsideTemp         : BOOL;
bReqValve               : BOOL;
bStateManSwitch         : BOOL;
udiSecRT_StopDelay      : UDINT;
udiSecRT_FeedbPumpDelay : UDINT;
eStateModeActuator      : E_HVACActuatorMode;
bError                  : BOOL;
byError                 : BYTE;
bErrorPumpProtec        : BOOL;
bErrorFeedb             : BOOL;
bInvalidParameter       : BOOL;

bPump: Output variable for controlling a pump. The following conditions must first be fulfilled in order to control the pump via bPump: bEnable = TRUE AND bErrorPumpProtec = FALSE AND bManSwitch = TRUE AND bCtrlVoltage = TRUE.
If these conditions are satisfied the pump can be switched on directly via the operation mode eCtrlModeActuator or via different possibilities in automatic mode, see diagram above.
The output bPump switches itself off, after the switch-on conditions are no longer fulfilled, depending on the Enum E_HVACReqPump, the input bExternal, the outside temperature rOutSideTemp or the valve position rValvePosition, with a delay set by the time udiSecStopDelay.

byState: Pump status output
byState.0 := bEnable;
byState.1 := bPump;
byState.2 := bReqExternal;
byState.3 := bReqOutsideTemp;
byState.4 := bReqValve;
byState.5 := bFeedbPump;
byState.6 := NOT bManSwitch;
byState.7 := bCtrlVoltage;

bReqExternal: If the condition bExternal = TRUE is fulfilled for switching on the pump via bPump, then the output variable bReqExternal goes TRUE. All switch-on conditions and the use of the output bReqExternal to control bPump are described in the diagrams above.

bReqOutsideTemp: If the condition is achieved for requesting the pump via bPump depending on the outside temperature rOutsideTemp, then the output variable bReqOutsideTemp goes TRUE. All switch-on conditions and the use of the output bReqOutsideTemp to control bPump are described in thediagrams above.

bReqValve: If the condition is achieved for requesting the pump via bPump depending on the valve position rValvePosition, the output variable bReqValve goes TRUE. All switch-on conditions and the use of the output bReqValve to control bPump are described in the diagrams above.

bStateManSwitch: Indicates the state of the manual/emergency switch. A TRUE signals that the manual/emergency operating level is activated. bStateManSwitch = NOT bManSwitch.

udiSecRT_StopDelay: If the operation mode eHVACActuatorMode_Auto_BMS OR eHVACActuatorMode_Auto_OP is selected, then the output bPump is switched off after the switch-on conditions are no longer satisfied, depending on the enum E_HVACReqPump, the input bExternal, the outside temperature rOutSideTemp or the valve position rValvePosition, delayed by the time set by udiSecRT_StopDelay. The output is given in seconds.

udiSecRT_FeedbPumpDelay: If the output bPump = TRUE, then the input bFeedbPump must be TRUE within the time udiSecRT_FeedbPumpDelay and must remain so until bPump = FALSE. This error is otherwise indicated via the output variable bErrorFeedb.
udiSecRT_FeedbPumpDelay is active only in the operation mode eHVACActuatorMode_Auto_BMS OR eHVACActuatorMode_Auto_OP and only if the time udiSecFeedbPumpDelay is greater than 0. The output is given in seconds.

eStateModeActuator: Indicates the operation mode of the function block. eStateModeActuator is equivalent to eCtrlModeActuator (see E_HVACActuatorMode).

bError: bError goes TRUE if bErrorPumpProtec is TRUE. However, only the error bErrorPumpProtec leads to the deactivation of the output bPump. If the error message bErrorFeedb is also to lead to the switch-off of the pump, then the variable must be ANDed with the output bPump after calling the function block.

byError: Output of the error as a byte.
byError.1 := bInvalidParameter
byError.2 := bError
byError.3 := bErrorPumpProtec
byError.4 := bErrorFeedb

bErrorPumpProtec: The motor protection switch for the pump is connected to the input bPumpProtec. There is a pump error if the input bPumpProtec is FALSE. If there is an error the output bPump goes FALSE and the error is displayed by means of the variable bErrorPumpProtec. The output bPump can only be switched on if bPumpProtec = TRUE (quiescent current principle). After the rectification of the fault it must be acknowledged at the input bReset.

bErrorFeedb: If the output bPump = TRUE, then the input bFeedbPump must be TRUE within the time specification udiSecFeedbPumpDelay and must remain so until bPump = FALSE. This error is otherwise indicated via the output variable bErrorFeedb. After the rectification of the fault it must be acknowledged at the input bReset. The error message bErrorFeedb has no effect on the control of the output bPump.
bErrorFeedb is active only in the operation mode eHVACActuatorMode_Auto_BMS OR eHVACActuatorMode_Auto_OP and only if the time udiSecFeedbPumpDelay is greater than 0.

bInvalidParameter: Goes TRUE if an error occurs during the plausibility check of the following variables: rOutsideTempHighLimit, rOutsideTempLowLimit, rValvePositionLimitOn, rValvePositionLimitOff
The message must be acknowledged with bReset.

VAR_IN_OUT

udiSecStopDelay        : UDINT;
udiSecFeedbPumpDelay   : UDINT;
rOutsideTempHighLimit  : REAL;
rOutsideTempLowLimit   : REAL;
rValvePositionLimitOn  : REAL;
rValvePositionLimitOff : REAL;
eReqPump               : E_HVACReqPump;

udiSecStopDelay: The time delay udiSecStopDelay [s] delays the switching off of the pump after the switch-on conditions are no longer fulfilled. It is input in seconds (0s..4294967s). If the operation mode eHVACActuatorMode_Auto_BMS OR eHVACActuatorMode_Auto_OP is selected, then the output bPump is switched off after the switch-on conditions are no longer satisfied, depending on the enum eReqPump, the input bExternal, the outside temperature rOutSideTemp or the valve position rValvePosition, delayed by the time set by udiSecStopDelay. The data is given in seconds. The variable is saved persistently. Preset to 0.

udiSecFeedbPumpDelay: If the output bPump = TRUE, then the input bFeedbPump must be TRUE within the time delay udiSecFeedbPumpDelay and must remain so until bPump = FALSE. Otherwise this error is indicated via the output variable bErrorFeedb (0s..4294967s).
udiSecFeedbPumpDelay is active only in the operation mode eHVACActuatorMode_Auto_BMS OR eHVACActuatorMode_Auto_OP and only if the time udiSecFeedbPumpDelay is greater than 0. The input is given in seconds. The variable is saved persistently. Preset to 0.

rOutsideTempHighLimit: Value above which the pump is switched on or off depending on the outside temperature rOutsideTemp and the enum eReqPump, see diagrams above (-60°C..60°C).
rOutsideTempHighLimit is active only in the operation mode eHVACActuatorMode_Auto_BMS OR eHVACActuatorMode_Auto_OP.
If an incorrect variable value is present on rOutsideTempHighLimit, the last valid variable value is taken. bInvalidParameter is set in the case of an incorrect parameter specification. The variable is saved persistently. Preset to 4.

rOutsideTempLowLimit: Value below which the pump is switched on or off depending on the outside temperature rOutsideTemp and the enum eReqPump, see diagrams above (-60°C..60°C).
rOutsideTempLowLimit is active only in the operation mode eHVACActuatorMode_Auto_BMS OR eHVACActuatorMode_Auto_OP.
If an incorrect variable value is present on rOutsideTempLowLimit, the last valid variable value is taken. bInvalidParameter is set in the case of an incorrect parameter specification. The variable is saved persistently. Preset to 1.

rValvePositionLimitOn: Threshold value for the position rValvePosition of a control valve associated with a pump, above which the pump should switch on automatically, e.g. heater pump, see diagrams above (0%..100%).
rValvePositionLimitOn
is active only in the operation mode eHVACActuatorMode_Auto_BMS OR eHVACActuatorMode_Auto_OP.
rValvePositionLimitOn may not be smaller than rValvePositionLimitOff. Otherwise the last valid variable value is taken and bInvalidParameter is set.
If an incorrect variable value is present on rValvePositionLimit, the last valid variable value is taken. bInvalidParameter is set in the case of an incorrect parameter specification. The variable is saved persistently. Preset to 5.

rValvePositionLimitOff: Threshold value for the position rValvePosition of a control valve associated with a pump, below which the pump should switch off automatically, e.g. heater pump, see diagrams above (0%..100%).
rValvePositionLimitOff
is active only in the operation mode eHVACActuatorMode_Auto_BMS OR eHVACActuatorMode_Auto_OP.
rValvePositionLimitOff may not be larger than rValvePositionLimitOn. Otherwise the last valid variable value is taken and bInvalidParameter is set.
If an incorrect variable value is present on rValvePositionLimit, the last valid variable value is taken. bInvalidParameter is set in the case of an incorrect parameter specification. The variable is saved persistently. Preset to 1.

eReqPump: Using the Enum E_HVACReqPump, switch-on conditions or combinations of switch-on conditions can be set for switching on the pump.
The switch-on conditions are as follows:

- depending on the outside temperature, the pump can be switched on if the temperature falls below the limit value rOutsideTempLowLimit or exceeds the limit value rOutsideTempHighLimit.

- depending on the position rValvePosition of the valve associated with the pump, the pump can be switched on when the threshold value rValvePositionLimitOn is exceeded.

In addition, the Enum combinations can be used to specify whether the temperature-dependent and valve-position-dependent switch-on conditions are ORed or ANDed together.

The following switch-on conditions or combinations of switch-on condition can be set via the Enum in order to control the output bPump:

eHVACReqPump_No: There is no request on the part of the Enum to control the pump

eHVACReqPump_OT_LL: The outside temperature (OT = rOutsideTemp) must be smaller than rOutsideTempLowLimit (LL = Lower Limit)

eHVACReqPump_OT_HL: The outside temperature (OT = rOutsideTemp) must be larger than rOutsideTempHighLimit (HL = Higher Limit)

eHVACReqPump_VP: The valve position (VP = rValvePosition) must be larger than rValvePositionLimitOn

eHVACReqPump_OT_LL_OR_VP: The outside temperature (OT = rOutsideTemp) must be smaller than rOutsideTempLowLimit (LL = Lower Limit) OR The valve position (VP = rValvePosition) must be larger than rValvePositionLimitOn

eHVACReqPump_OT_HL_OR_VP: The outside temperature (OT = rOutsideTemp) must be larger than rOutsideTempHighLimit (HL = Higher Limit) OR the valve position (VP = rValvePosition) must be larger than rValvePositionLimitOn

eHVACReqPump_OT_LL_AND_VP: The outside temperature (OT = rOutsideTemp) must be smaller than rOutsideTempLowLimit (LL = Lower Limit) AND The valve position (VP = rValvePosition) must be larger than rValvePositionLimitOn

eHVACReqPump_OT_HL_AND_VP: The outside temperature (OT = rOutsideTemp) must be larger than rOutsideTempHighLimit (HL = Higher Limit) AND the valve position (VP = rValvePosition) must be larger than rValvePositionLimitOn

Prerequisites for the use of the enum eReqPump are that bEnable = TRUE AND bErrorPumpProtec = FALSE AND bManSwitch = TRUE AND bCtrlVoltage = TRUE AND eCtrlModeActuator = eHVACActuatorMode_Auto_BMS OR eHVACActuatorMode_Auto_OP.
If an incorrect variable value is present on eReqPump, the last valid variable value is taken. bInvalidParameter is set in the case of an incorrect parameter specification. The variable is saved persistently.

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