FB_BARSunblindWeatherProtection

The weather protection has the highest priority in the blind controller (see overview) and is intended to ensure that the blind is not damaged by ice or wind.

FB_BARSunblindWeatherProtection 1:

The task of the automatic weather protection function is to protect the blind against two impending dangers and, in order to do so, to drive it to a safe position:

In both cases of danger the blind is driven to the protection position specified by uiPositionProtection (height position in percent) and iAngleProtection (slat angle in degrees).

VAR_INPUT

eDataSecurityType   : E_HVACDataSecurityType;
bEnable             : BOOL;
lrWindSpeed         : LREAL;
lrOutsideTemperature: LREAL;
bRainSensor         : BOOL;

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_BARSunblindWeatherProtection 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.

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.

lrWindSpeed: wind speed. The unit of the entry is arbitrary, but it is important that no value is smaller than 0 and that the values become larger with increasing speed.

rOutsideTemperature: outside temperature in degrees Celsius.

bRainSensor: input for a rain sensor.

VAR_OUTPUT

stSunblind                : ST_BARSunblind;
bIceAlarm                 : BOOL;
udiRemainingTimeIceAlarm  : UDINT;
bStormAlarm               : BOOL;
uiRemainingTimeStormDetect: UINT;
uiRemainingTimeStormAlarm : UINT;
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.

bIceAlarm: displays the icing-up alarm.

udiRemainingTimeIceAlarm: in the case of impending icing up (bIceAlarm = TRUE), this second counter is set to the deicing time. As soon as the temperature lies above the frost point entered (rFrostTemperature), the remaining number of seconds until the 'all-clear' signal is given (bIceAlarm = FALSE) is displayed here. This output is 0 as long as no countdown of the time is taking place.

bStormAlarm: displays the storm alarm.

uiRemainingTimeStormDetect: in an uncritical case this second counter constantly displays the alarm delay time uiDelayStormUpcoming. If the measured wind speed rWindSpeed is above the activation limit value rWindSpeedStormUpcoming, the seconds to the alarm are counted down. This output is 0 as long as no countdown of the time is taking place.

uiRemainingTimeStormAlarm: as soon as the storm alarm is triggered, this second counter first constantly displays the deactivation time delay of the storm alarm uiDelayStormAbating. If the measured wind speed rWindSpeed falls below the deactivation limit value rWindSpeedStormAbating, the seconds to the all-clear signal (bStormAlarm=FALSE) are counted down. This output is 0 as long as no countdown of the time is taking place.

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_BARSunblindWeatherProtection 3:

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_BARSunblindWeatherProtection 4:Example_PERSISTENT.zip.

lrFrostTemperature       : LREAL;
lrWindSpeedStormUpcoming : LREAL;
lrWindSpeedStormAbating  : LREAL;
uiDeiceTime              : UINT;
uiDelayStormUpcoming     : UINT;
uiDelayStormAbating      : UINT;
uiPositionProtection     : UINT;
iAngleProtection         : INT;

lrFrostTemperature: icing-up temperature limit value in degrees Celsius. This value may not be greater than 0. Otherwise an error is output.

lrWindSpeedStormUpcoming: wind speed limit value for the activation of the storm alarm. This value may not be smaller than 0 and must lie above the value for the deactivation. Otherwise an error is output. The unit of the entry must be the same as that of the input rWindSpeed. A value greater than this limit value triggers the alarm after the entered time uiDelayStormUpcoming.

lrWindSpeedStormAbating: wind speed limit value for the deactivation of the storm alarm. This value may be not smaller than 0 and must lie below the value for the activation. Otherwise an error is output. The unit of the entry must be the same as that of the input rWindSpeed. A value smaller than or equal to this limit value resets the alarm after the entered time uiDelayStormAbating.

uiDeiceTime: time until the deicing of the blind after icing up (in minutes). After that the icing up alarm is reset.

uiDelayStormUpcoming: time delay until the storm alarm is triggered in seconds.

uiDelayStormUpcoming: time delay until the storm alarm is reset in seconds.

uiPositionProtection: height position of the blind in % in the case of protection.

iAngleProtection: slat angle of the blind in degrees in the case of protection.