FB_HVACSummerNightCooling

FB_HVACSummerNightCooling 1:

Application

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 to enable summer night cooling:
- bEnable = TRUE
- rOutsideTemp
> (rMinimumOutsideTemp + 0.2K)
- ((rRoomTemp - rOutsideTemp) > rDifferOutsideRoomTempOn)
- ((rRoomTemp - rSetpointRoomTemp) > rDifferRoomSetpointTemp)
- the system time dtSystemtime must lie within the timeframe todStartTime to 12:00 noon

It is sufficient to disable summer night cooling bOn = FALSE if one of the following conditions is met:
- bEnable = FALSE
- (rOutsideTemp < (rMinimumOutsideTemp - 0.2K))
- ((rRoomTemp - rOutsideTemp) < rDifferOutsideRoomTempOff)
- the system time dtSystemtime is outside of the timeframe from todStartTime to 12:00 noon
- the summer night cooling had been activated for the maximum time tMaxRuntime within the timeframe of todStartTime to 12:00 noon. Summer night cooling can be switched on several times within this timeframe.

VAR_INPUT

eDataSecurityType: E_HVACDataSecurityType;
bSetDefault      : BOOL;
bEnable          : BOOL;
rOutsideTemp     : REAL;
rRoomTemp        : REAL;
rSetpointRoomTemp: REAL;
dtSystemTime     : DT;
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: FB_HVACSummerNightCooling 2: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.

rOutsideTemp: input for the outside temperature.

rRoomTemp: input for the room temperature.

rSetpointRoomTemp: setpoint for the room temperature

dtSystemTime: this variable transfers the computer system time to the function block.

bReset: acknowledge input in the event of a fault.

VAR_OUTPUT

bOn              : BOOL;
bInvalidParameter: BOOL;

bOn: if bOn = TRUE, the summer night cooling is activated.
The following conditions must be met to activate summer night cooling:
bEnable = TRUEANDrOutsideTemp > (rMinimumOutsideTemp + 0.2K) AND ((rRoomTemp - rOutsideTemp) > rDifferOutsideRoomTempOn) AND
((rRoomTemp - rSetpointRoomTemp) > rDifferRoomSetpointTemp) AND the system time dtSystemtime must lie within the timeframe todStartTime until 12:00 noon.

It is sufficient to disable the summer night cooling bOn = FALSE if one of the following conditions is met:
bEnable = FALSEOR (rOutsideTemp < (rMinimumOutsideTemp - 0.2K)) OR ((rRoomTemp - rOutsideTemp) < rDifferOutsideRoomTempOff) OR the system time dtSystemtime is outside of the timeframe from todStartTime to 12:00 noon OR the summer night cooling had been activated for the maximum time tMaxRuntime within the system time of todStartTime to 12:00 noon. Summer night cooling can be switched on several times within this timeframe.

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

VAR_IN_OUT

rMinimumOutsideTemp       : REAL;
rDifferOutsideRoomTempOn  : REAL;
rDifferOutsideRoomTempOff : REAL;
rDifferRoomSetpointTemp   : REAL;
todStartTime              : TOD;
tMaxRuntime               : TIME;

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). The variable is saved persistently. Preset to 10 °C.

rMinimumOutsideTemp must be within its range.
If a variable value is not correct, the last valid variable value is used, if available. If there is no valid last value, then the default value is used. bInvalidParameter is set if the parameter is incorrect.

rDifferOutsideRoomTempOn: the difference rRoomTemp - rOutsideTemp must be greater than the amount of rDifferOutsideRoomTempOn so that one of the conditions for activating summer night cooling bOn = TRUE is met (0. .100).
((rRoomTemp - rOutsideTemp) > rDifferOutsideRoomTempOn)

rDifferOutsideRoomTempOn must be 0.4 K higher than rDifferOutsideRoomTempOff. In addition, rDifferOutsideRoomTempOn must be within its range.
If a variable value is not correct, the last valid variable value is used, if available. If there is no valid last value, then the default value is used. bInvalidParameter is set if the parameter is incorrect.

The variable is saved persistently. Preset to 5 °C.

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

rDifferOutsideRoomTempOff must be 0.4 K smaller than rDifferOutsideRoomTempOn. In addition, rDifferOutsideRoomTempOff must be within its range (0..100).
If a variable value is not correct, the last valid variable value is used, if available. If there is no valid last value, then the default value is used. bInvalidParameter is set if the parameter is incorrect. The variable is saved persistently. Preset to 2 °C.

rDifferRoomSetpointTemp: the room temperature must be greater than the room temperature setpoint by this amount so that one of the conditions for activating summer night cooling bOn = TRUE is met.
((rRoomTemp - rSetpointRoomTemp) > rDifferRoomSetpointTemp)

rDifferRoomSetpointTemp must be within its range (0..100).
If a variable value is not correct, the last valid variable value is used, if available. If there is no valid last value, then the default value is used. bInvalidParameter is set if the parameter is incorrect.

The variable is saved persistently. Preset to 2 °C.

todStartTime: start time for the timeframe within which the summer night cooling can be activated (0..24). The timeframe for enabling summer night cooling starts with todStartTime and ends at 12 noon.

todStartTime must be within its range.
If a variable value is not correct, the last valid variable value is used, if available. If there is no valid last value, then the default value is used. bInvalidParameter is set if the parameter is incorrect. The variable is saved persistently. Preset to 2 o'clock.

tMaxRuntime: maximum runtime of the summer night cooling function within the timeframe between todStartTime and 12 noon (>0s). Summer night cooling can be switched on several times within this timeframe, but the total time cannot exceed tMaxRuntime.

tMaxRuntime must be grater thanT#0s.
If an incorrect variable value is present, the last valid variable value, if available, is used. If there is no valid last value, then the default value is used. bInvalidParameter is set if the parameter is incorrect. The variable is saved persistently. Preset to 20 min.