FB_BARSunblindThermoAutomatic

FB_BARSunblindThermoAutomatic 1:

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.

The thermo-automatic function 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 three cases:

Once the heating or the cooling case has been reached, the thermo-automatic function remembers this until it becomes inactive itself once again due to renewed presence detection or insufficient external brightness (see above).
In both cases, however – heating or cooling – the mechanism operates like a 2-point 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 ; 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, then the blind drives to the heating position uiPositionHeatingMode and iAngleHeatingMode.
The lower limit value is selectable by the parameter bComfortHeatingAsSwitchPointCooling ; 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:= 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.

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

uiBrightness: External brightness in lux.

bPresence: The automatic function is active only it the room is unoccupied, since otherwise the sun shading takes priority. If this input is FALSE, the room is considered to be unoccupied and the thermo-automatic function is active. A TRUE signal at bPresence deactivates the thermo-automatic function 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 serves merely to indicate whether the function block is sending an active telegram.

uiRemainingTimeActivate: The thermo-automatic function 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 thermo-automatic function 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).

lrLowerSwitchPointHeating: 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 selected 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 4:

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

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

In order for the registered parameters to be retained beyond a controller failure, it is necessary to declare them as In-Out variables. A reference variable is then assigned to them in the program. Each change of the value of these reference variables is persistently stored in the function block and written back to the reference variable following a controller failure and restart. If the parameters were only to be defined as input variables, they would not be able to write a reference variable.
Application example: example_persistent.zip.

uiBrightnessActivateValue / uiActivateDelay : Activation limit value. The thermo-automatic function is active only if the external 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 external 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 : Deactivation limit value of the brightness: If the external brightness uiBrightness [lux] falls below the value uiBrightnessDeactivateValue [lux] for the time uiDeactivateDelay [s], then the automatic function 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 upper 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 for 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 for 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).

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