FB_HVACSummerNightCoolingEx
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 activate summer night cooling:
- bEnable = TRUE
- rOutsideTemp > (rMinimumOutsideTemp + 0.2K); the value of 0.2K is an internal constant of the function block.
- (rRoomTemp - rOutsideTemp) > rDifferOutsideTempRoomTempOn
-(rRoomTemp - rSetpointRoomTemp) > rDifferRoomTempSetpointRoomTempOn
- udiSecRT_MaxRuntime > 0
It is sufficient to disable the summer night cooling bOn = FALSE if one of the following conditions is met:
- bEnable = FALSE
- rOutsideTemp < (rMinimumOutsideTemp - 0.2K); the value of 0.2K is an internal constant of the function block.
- (rRoomTemp - rOutsideTemp) < rDifferOutsideTempRoomTempOff
-udiSecRT_MaxRuntime = 0
Attention 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
The application example shows the function block FB_HVACSummerNightCoolingEx in conjunction with the weekly timer FB_HVACScheduler1ch. The example is available in the programming languages ST and CFC. The program example P_CFC_SummernightCoolingEx.PRG for the CFC programming languages can be found in the folder Language CFC > SpecialFunctions, the program example P_ST_SummernightCoolingEx.PRG for the ST programming languages in the folder Language Structur Text > SpecialFunctions.
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 for 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 to activate summer night cooling:
- bEnable = TRUE
- rOutsideTemp > (rMinimumOutsideTemp + 0.2K); the value of 0.2K is an internal constant of the function block.
- (rRoomTemp - rOutsideTemp) > rDifferOutsideTempRoomTempOn
-(rRoomTemp - rSetpointRoomTemp) > rDifferRoomTempSetpointRoomTempOn
- udiSecRT_MaxRuntime > 0
It is sufficient to disable the summer night cooling bOn = FALSE if one of the following conditions is met:
- bEnable = FALSE
- rOutsideTemp < (rMinimumOutsideTemp - 0.2K); the value of 0.2K is an internal constant of the function block.
- (rRoomTemp - rOutsideTemp) < rDifferOutsideTempRoomTempOff
-udiSecRT_MaxRuntime = 0
bStateDifferOutsideTempMinOutsideTemp: state display. bStateDifferOutsideTempMinOutsideTemp is TRUE if rOutsideTemp > (rMinimumOutsideTemp + 0.2). bStateDifferOutsideTempMinOutsideTemp is FALSE if rOutsideTemp < (rMinimumOutsideTemp - 0.2).
rStateDifferOutsideTempMinOutsideTemp: value of difference rOutsideTemp - rMinimumOutsideTemp
bStateDifferRoomTempOutsideTemp: state display. bStateDifferRoomTempOutsideTempis TRUE if (rRoomTemp - rOutsideTemp) > rDifferOutsideTempRoomTempOn. bStateDifferRoomTempOutsideTempis FALSE if (rRoomTemp - rOutsideTemp) < rDifferOutsideTempRoomTempOff is.
rStateDifferRoomTempOutsideTemp: value of difference rRoomTemp - rOutsideTemp
bStateDifferRoomTempSetpointRoomTemp: state display. bStateDifferRoomTempSetpointRoomTemp is TRUE if (rRoomTemp - rSetpointRoomTemp) > rDifferRoomTempSetpointRoomTempOn. bStateDifferRoomTempSetpointRoomTemp is FALSE if (rRoomTemp - rSetpointRoomTemp) <= rDifferRoomTempSetpointRoomTempOn is.
rStateDifferRoomTempSetpointRoomTemp: value of difference rRoomTemp - rSetpointRoomTemp
udiSecRT_MaxRuntime: remaining summer night cooling time. If udiSecRT_MaxRuntime = 0, the summer night cooling function can be enabled again only if bEnable is FALSE for at least one PLC cycle
bInvalidParameter: Indicates that an incorrect input parameter is present. 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 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 10 °C.
rDifferOutsideTempRoomTempOn: the difference rRoomTemp - rOutsideTemp must be greater than the amount of rDifferOutsideTempRoomTempOn so that one of the conditions for activating summer night cooling bOn = TRUE is met (0..10).
((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.
rDifferOutsideTempRoomTempOff: the difference rRoomTemp - rOutsideTemp must be less than the amount of rDifferOutsideTempRoomTempOff 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..10).
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.
rDifferRoomTempSetpointRoomTempOn: 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 (0..10).
((rRoomTemp - rSetpointRoomTemp) > rDifferRoomSetpointTemp)
rDifferRoomSetpointTemp 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 °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 grater than 0.
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 180.