FB_BARSunblindThermoAutomatic

This function block controls the blind in relation to the temperature inside the room if the room is unoccupied.
The objective is to block radiant heat when cooling and to increase the input of heat by opening the blinds when heating.

FB_BARSunblindThermoAutomatic 1:

The thermal automatic is active only if there is sufficient sunshine and the room concerned is unoccupied. To this end, the external brightness value uiBrightness [lux] must have exceeded the activation limit value uiBrightnessActivateValue for the time uiActivateDelay (in seconds) and the presence input bPresence must be FALSE. The automatic function is deactivated again if either presence is signaled (bPresence = TRUE) or the external brightness value uiBrightness falls below the value uiBrightnessDeactivateValue for the time uiDeactivateDelay.

A structure of the type ST_BARSetpointRoom, which carries the information about the temperature switching points for the air conditioning of the room, is to be applied at the input stBARSetpointRoom:

TYPE ST_BARSetpointRoom :
STRUCT
     stBARSetpointRoom_ComfortHeat     : REAL:= 21.0;
     stBARSetpointRoom_PreComfortHeat  : REAL:= 19.0;
     stBARSetpointRoom_EconomyHeat     : REAL:= 15.0;
     stBARSetpointRoom_ProtectionHeat  : REAL:= 12.0;
     stBARSetpointRoom_ComfortCool     : REAL:= 24.0;
     stBARSetpointRoom_PreComfortCool  : REAL:= 28.0;
     stBARSetpointRoom_EconomyCool     : REAL:= 35.0;
     stBARSetpointRoom_ProtectionCool  : REAL:= 40.0;
END_STRUCT
END_TYPE

Once activated, the thermo-automatic function distinguishes between 3 cases:

Once the heating or the cooling case has been reached, the thermal automatic remembers this until it becomes inactive itself once again due to renewed presence detection or insufficient outdoor brightness (see above).
In both cases, however – heating or cooling – the mechanism operates like a on-off controller.

Heating case

In the heating case, the blind drives to the heating position uiPositionHeatingMode and iAngleHeatingMode if the room temperature falls below the lower limit value. If the room temperature exceeds the upper limit value, then the blind drives to the cooling position uiPositionCoolingMode and iAngleCoolingMode.
The upper limit value is selectable by the parameter bComfortCoolingAsSwitchPointHeating [BOOL], the lower limit value is not selectable:

 

bComfortCoolingAsSwitchPointHeating = FALSE

bComfortCoolingAsSwitchPointHeating = TRUE

upper limit value

stBARSetpointRoom_PreComfortCool

stBARSetpointRoom_ComfortCool

lower limit value

stBARSetpointRoom_ComfortHeat

stBARSetpointRoom_ComfortHeat


Diagram

FB_BARSunblindThermoAutomatic 2:

Cooling case

In the cooling case the blind drives to the cooling position uiPositionCoolingMode and iAngleCoolingMode if the room temperature exceeds the upper limit value. If the room temperature falls below the lower limit value, then the blind drives to the heating position uiPositionHeatingMode and iAngleHeatingMode.
The lower limit value is selectable by the parameter bComfortHeatingAsSwitchPointCooling [BOOL], the upper limit value is not selectable:

 

bComfortHeatingAsSwitchPointCooling = FALSE

bComfortHeatingAsSwitchPointCooling = TRUE

upper limit value

stBARSetpointRoom_ComfortCool

stBARSetpointRoom_ComfortCool

lower limit value

stBARSetpointRoom_PreComfortHeat

stBARSetpointRoom_ComfortHeat


Diagram

FB_BARSunblindThermoAutomatic 3:

A lower average room temperature is obtained by selecting the Precomfort Cool value instead of the Comfort Cool value as the upper hysteresis point. This could be perceived as more pleasant when re-entering the room.

VAR_INPUT

eDataSecurityType   : E_HVACDataSecurityType;
bEnable             : BOOL;
uiBrightness        : UINT;
bPresence           : BOOL;
lrActRoomTemperature: LREAL;
stBARSetpointRoom   : ST_BARSetpointRoom;

eDataSecurityType:if eDataSecurityType:= eDataSecurityType_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_BARSunblindThermoAutomatic 4: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.

bEnable : the function block has no function if this input is FALSE. In the positioning telegram stSunblind, 0 is output for the position and the angle, and bActive is FALSE. This means that another function takes over control of the blind via the priority controller.

uiBrightness: outdoor brightness in lux.

bPresence: the automatic function is active only if the room is unoccupied, since otherwise the sun protection takes priority. If this input is FALSE, the room is considered to be unoccupied and the thermal automatic is active. A TRUE signal at bPresence deactivates the thermal automatic immediately.

lrActRoomTemperature: input for the room temperature in °C.

stBARSetpointRoom: structure of the type ST_BARSetpointRoom, which contains the information about the temperature switching points for the air conditioning of the room, see above.

VAR_OUTPUT

stSunblind               : ST_BARSunblind;
bActive                  : BOOL;
uiRemainingTimeActivate  : UINT;
uiRemainingTimeDeactivate: UINT;
bHeating                 : BOOL;
bCooling                 : BOOL;
lrUpperSwitchPointHeating: LREAL;
lrLowerSwitchPointHeating: LREAL;
lrUpperSwitchPointCooling: LREAL;
lrLowerSwitchPointCooling: LREAL;
bError                   : BOOL;
udiErrorId               : UDINT;

stSunblind: output structure of the blind positions, see ST_BARSunblind.

bActive : corresponds to the boolean value bActive in the blind telegram ST_BARSunblind and is solely used to indicate whether the function block sends an active telegram.

uiRemainingTimeActivate: the thermal automatic is active if no presence is detected AND the brightness lies above the limit value uiBrightnessActivateValue for the time uiActivateDelay (switching delay). This output indicates the remaining duration of the switching delay in seconds. This output is 0 as long as no countdown of the time is taking place.

uiRemainingTimeDeactivate: the thermal automatic is not active if presence is detected OR if the brightness lies below the limit value uiBrightnessDeactivateValue for the time uiDeactivateDelay (switching delay). This output indicates the remaining duration of the switching delay in seconds. This output is 0 as long as no countdown of the time is taking place.

bHeating : indicates whether the heating case is active.

bCooling : indicates whether the cooling case is active.

lrUpperSwitchPointHeating : indicates the selected upper switch point in heating mode at which the blind is driven to the position uiPositionCoolingMode for cooling. This is either stBARSetpointRoom_ComfortCool or stBARSetpointRoom_PreComfortCool, depending on the preselection (see diagrams above).

lrUpperSwitchPointHeating : indicates the lower switch point in heating mode at which the blind is driven to the position uiPositionHeatingMode for heating. This is permanently set as the value stBARSetpointRoom_ComfortHeat (see diagrams above).

lrUpperSwitchPointCooling : indicates the upper switch point in cooling mode at which the blind is driven to the position uiPositionCoolingMode for cooling. This is permanently set as the value stBARSetpointRoom_ComfortCool (see diagrams above).

lrLowerSwitchPointCooling : indicates the selected lower switch point in cooling mode at which the blind is driven to the position uiPositionHeatingMode for heating. This is either stBARSetpointRoom_ComfortHeat or stBARSetpointRoom_PreComfortHeat, depending on the preselection (see diagrams above).

bError: this output is switched to TRUE if the parameters entered are erroneous.

udiErrorId : contains the error code if the values entered should be erroneous. See error codes.

FB_BARSunblindThermoAutomatic 5:

If an error should occur, then this automatic function is deactivated and position and angle are set to 0. This means that if a priority controller is in use, another function with a lower priority (see Overview) automatically takes over control of the blind. In the case of a direct connection, conversely, the blind will drive to position/angle 0.

VAR_IN_OUT

The need for entered parameters to be preserved across a control failure makes it necessary for them to be declared as IN-OUT variables. A reference variable is then assigned to them in the program. Each change in the value of this reference variable is persistently saved in the function block and written back to the reference variable after a controller failure and restart. If the parameters were only declared as input variables, they would not be able to write a reference variable.
Application example: FB_BARSunblindThermoAutomatic 6:Example_PERSISTENT.zip.

uiBrightnessActivateValue          : UINT;(*lux*)
uiBrightnessDeactivateValue        : UINT;(*lux*)
uiActivateDelay                    : UINT;(*sec*)
uiDeactivateDelay                  : UINT;(*sec*)
bComfortHeatingAsSwitchPointCooling: BOOL;
bComfortCoolingAsSwitchPointHeating: BOOL;
uiPositionHeatingMode              : UINT;
iAngleHeatingMode                  : INT;
uiPositionCoolingMode              : UINT;
iAngleCoolingMode                  : INT;

uiBrightnessActivateValue / uiActivateDelay : activation limit value. The thermal automatic is active only if the outdoor brightness is adequate. Otherwise there would be no radiant heat from the sun which could be utilized or which would need to be blocked. If the outdoor brightness uiBrightness [lux] exceeds the value uiBrightnessActivateValue [lux] for the time uiActivateDelay [s], then the automatic function becomes active if in addition no presence is detected (bPresence = FALSE).

uiBrightnessDeactivateValue / uiDeactivateDelay : brightness deactivation limit value: if the outdoor brightness uiBrightness [lux] falls below the value uiBrightnessDeactivateValue [lux] for the time uiDeactivateDelay [s] , the automatic system becomes inactive. The value uiBrightnessDeactivateValue must be smaller than the value uiBrightnessActivateValue. Otherwise an error is output.

bComfortHeatingAsSwitchPointCooling : if this input is TRUE, then the value stBARSetpointRoom_ComfortHeat is considered to be the lower value in cooling mode from which the blinds are opened again. If the input is set to FALSE, then the value stBARSetpointRoom_PreComfortHeat applies (see introductory description).

bComfortCoolingAsSwitchPointHeating : if this input is TRUE, then the value stBARSetpointRoom_ComfortCool is considered to be the lower value in heating mode from which the blinds are closed again. If the input is set to FALSE, then the value stBARSetpointRoom_PreComfortCool applies (see introductory description).

uiPositionHeatingMode : height position of the blind in % in the heating case (intended heat irradiation). The following applies to the height position: 0% = fully open, 100% = fully closed.

iAngleHeatingMode : slat angle of the blind in degrees in the heating case (intended heat irradiation).

uiPositionCoolingMode : height position of the blind in % in the cooling case (sun protection). The following applies to the height position: 0% = fully open, 100% = fully closed. The value of the height position must be higher than in the heating case, i.e. the blind must be closed more in the cooling case than in the heating case. Otherwise the supply of heat from the sun cannot be meaningfully controlled according to the above description. In this case an error is output.

iAngleCoolingMode : slat angle of the blind in degrees in the cooling case (sun protection).