FB_HVACSummerNightCoolingEx

FB_HVACSummerNightCoolingEx 1:

With this function block, rooms that were heated up on the day before can be cooled down during the night using cool outside air. The summer night cooling function serves to improve the quality of the air and to save electrical energy. Electrical energy for cooling is saved during the first hours of the next summer day.

The start conditions for the summer night cooling are defined by parameterizing the FB_HVACSummerNightCooling function block. The function block can be used to open motor-driven windows or to switch air conditioning systems to summer night cooling mode outside their normal hours of operation. Summer night cooling mode is active if the output variable bOn is TRUE.

The following conditions must be met for activation of summer night cooling:
- bEnable = TRUE
- rOutsideTemp
> (rMinimumOutsideTemp + 0.2K); the value 0.2K is an internal constant of the function block.
- (rRoomTemp - rOutsideTemp) > rDifferOutsideTempRoomTempOn
-(rRoomTemp - rSetpointRoomTemp) > rDifferRoomTempSetpointRoomTempOn
- udiSecRT_MaxRuntime > 0

For the deactivation of summer night cooling bOn = FALSE it is sufficient if one of the following condition is met:
- bEnable = FALSE
- rOutsideTemp < (rMinimumOutsideTemp - 0.2K); the value 0.2K is an internal constant of the function block.
- (rRoomTemp - rOutsideTemp) < rDifferOutsideTempRoomTempOff
-udiSecRT_MaxRuntime = 0

FB_HVACSummerNightCoolingEx 2:

Summer night cooling can be switched on and off several times within the time udiSecMaxRuntime. Once udiSecRT_MaxRuntime has elapsed the summer night cooling function can only be reactivated if bEnable is FALSE for at lease one PLC cycle. The function block and the summer night cooling function can be enabled via a timer.

Program flowchart

FB_HVACSummerNightCoolingEx 3:

VAR_INPUT

eDataSecurityType   : E_HVACDataSecurityType;
bSetDefault         : BOOL;
bEnable             : BOOL;
rOutsideTemp        : REAL;
rRoomTemp           : REAL;
rSetpointRoomTemp   : REAL;
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 by the PLC program with the input variable bEnable. Once the time udiSecMaxRuntime has elapsed the summer night cooling function can only be reactivated if bEnable is FALSE for at lease one PLC cycle. The function block could be enabled via a timer.
rOutsideTemp: Input for the outside temperature.

rRoomTemp: Input for the room temperature

rSetpointRoomTemp: Setpoint of the room temperature

bReset: Acknowledge input in the event of a fault.

VAR_OUTPUT

bOn                                      : BOOL;
bStateDifferOutsideTempMinOutsideTemp    : BOOL;
rStateDifferOutsideTempMinOutsideTemp    : REAL;
bStateDifferRoomTempOutsideTemp          : BOOL;
rStateDifferRoomTempOutsideTemp          : REAL;
bStateDifferRoomTempSetpointRoomTemp     : BOOL;
rStateDifferRoomTempSetpointRoomTemp     : REAL;
udiSecRT_MaxRuntime                      : UDINT;
bInvalidParameter                        : BOOL;

bOn: If bOn = TRUE summer night cooling is active.

The following conditions must be met for activation of summer night cooling:
- bEnable = TRUE
- rOutsideTemp
> (rMinimumOutsideTemp + 0.2K); the value 0.2K is an internal constant of the function block.
- (rRoomTemp - rOutsideTemp) > rDifferOutsideTempRoomTempOn
-(rRoomTemp - rSetpointRoomTemp) > rDifferRoomTempSetpointRoomTempOn
- udiSecRT_MaxRuntime > 0

For the deactivation of summer night cooling bOn = FALSE it is sufficient if one of the following condition is met:
- bEnable = FALSE
- rOutsideTemp < (rMinimumOutsideTemp - 0.2K); the value 0.2K is an internal constant of the function block.
- (rRoomTemp - rOutsideTemp) < rDifferOutsideTempRoomTempOff
-udiSecRT_MaxRuntime = 0

bStateDifferOutsideTempMinOutsideTemp: Status display. bStateDifferOutsideTempMinOutsideTemp is TRUE if rOutsideTemp > (rMinimumOutsideTemp + 0.2). bStateDifferOutsideTempMinOutsideTemp is FALSE if rOutsideTemp < (rMinimumOutsideTemp - 0.2).

rStateDifferOutsideTempMinOutsideTemp: Value of the difference rOutsideTemp - rMinimumOutsideTemp

bStateDifferRoomTempOutsideTemp: Status display. bStateDifferRoomTempOutsideTemp is TRUE if (rRoomTemp - rOutsideTemp) > rDifferOutsideTempRoomTempOn. bStateDifferRoomTempOutsideTemp is FALSE if (rRoomTemp - rOutsideTemp) < rDifferOutsideTempRoomTempOff.

rStateDifferRoomTempOutsideTemp: Value of the difference rRoomTemp - rOutsideTemp

bStateDifferRoomTempSetpointRoomTemp: Status display. bStateDifferRoomTempSetpointRoomTemp is TRUE if (rRoomTemp - rSetpointRoomTemp) > rDifferRoomTempSetpointRoomTempOn. bStateDifferRoomTempSetpointRoomTemp is FALSE if (rRoomTemp - rSetpointRoomTemp) <= rDifferRoomTempSetpointRoomTempOn.

rStateDifferRoomTempSetpointRoomTemp: Value of the difference  rRoomTemp - rSetpointRoomTemp

udiSecRT_MaxRuntime: Remaining summer night cooling time. If udiSecRT_MaxRuntime = 0 the summer night cooling function can only be reactivated if bEnable is FALSE for at lease one PLC cycle

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

VAR_IN_OUT

rMinimumOutsideTemp              : REAL;
rDifferOutsideTempRoomTempOn     : REAL;
rDifferOutsideTempRoomTempOff    : REAL;
rDifferRoomTempSetpointRoomTempOn : REAL;
udiSecMaxRuntime                  : UDINT;

rMinimumOutsideTemp: If the outside temperature rOutsideTemp falls below the limit value (rMinimumOutsideTemp - 0.2 K), the summer night cooling function is disabled, i.e. bOn = FALSE. If the outside temperature rOutsideTemp exceeds the limit value (rMinimumOutsideTemp + 0.2K), then one of the conditions for activating the summer night cooling bOn = TRUE is satisfied (4..100).

rMinimumOutsideTemp must be within the specified range.
If an incorrect variable value is present, then the last valid variable value, if one, will be taken. If there is no valid last value, operation continues with the default value. bInvalidParameter is set in the case of an incorrect parameter specification. The variable is saved persistently. Preset to 10 °C.

rDifferOutsideTempRoomTempOn: The difference rRoomTemp - rOutsideTemp must be greater than the value of rDifferOutsideRoomTempOn so that one of the conditions for activating the summer night cooling bOn = TRUE is satisfied (0..10).
((rRoomTemp - rOutsideTemp) > rDifferOutsideRoomTempOn)

rDifferOutsideRoomTempOn must be 0.4 K higher than rDifferOutsideRoomTempOff. Furthermore rDifferOutsideRoomTempOn must be within its specified range.
If an incorrect variable value is present, then the last valid variable value, if one, will be taken. If there is no valid last value, operation continues with the default value. bInvalidParameter is set in the case of an incorrect parameter specification. The variable is saved persistently. Preset to 5 °C.

rDifferOutsideTempRoomTempOff: The difference rRoomTemp - rOutsideTemp must be less than the amount of rDifferOutsideTempRoomTempOff for summer night cooling to be disabled (bOn = FALSE).
((rRoomTemp - rOutsideTemp) < rDifferOutsideRoomTempOff)

rDifferOutsideRoomTempOff must be 0.4 K lower than rDifferOutsideRoomTempOn. In addition, rDifferOutsideRoomTempOff must lie within its range (0..10).
If an incorrect variable value is present, then the last valid variable value, if one, will be taken. If there is no valid last value, operation continues with the default value. bInvalidParameter is set in the case of an incorrect parameter specification. The variable is saved persistently. Preset to 2 °C.

rDifferRoomTempSetpointRoomTempOn: The room temperature must exceed the room temperature setpoint by this value to meet one of the conditions for activation of summer night cooling (bOn = TRUE) (0..10).
((rRoomTemp - rSetpointRoomTemp) > rDifferRoomSetpointTemp)

rDifferRoomSetpointTemp must lie within its range.
If an incorrect variable value is present, then the last valid variable value, if one, will be taken. If there is no valid last value, operation continues with the default value. bInvalidParameter is set in the case of an incorrect parameter specification. The variable is saved persistently. Preset to 2 °C.

udiSecMaxRuntime: Maximum runtime of the summer night cooling function. Summer night cooling can be switched on and off several times within the time. The remaining summer night cooling time is indicated via the variable udiSecRT_MaxRuntime.

udiSecMaxRuntime must be greater than 0.
If an incorrect variable value is present, then the last valid variable value, if one, will be taken. If there is no valid last value, operation continues with the default value. bInvalidParameter is set in the case of an incorrect parameter specification. The variable is saved persistently. Preset to 180.

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