FB_BARSunProtectionEx

FB_BARSunProtectionEx 1:

Function block for the control of glare protection with the aid of a slatted blind.

The function block FB_BARSunProtectionEx enables glare protection in two ways that operate in parallel:

On the basis of the parameters entered, which are described further below, the function block calculates the necessary slat angle and blind position and transfers them to the output structure stSunblind. Of course, the output does not take place continuously, since a constant blind movement would be perceived as extremely distracting. The interval in seconds at which new position values are to be output can be set on the input uiPositioningInterval.
However, the shading criteria must always be fulfilled between two positioning times: no direct light may enter through the slats and the desired incidence of light must remain limited by the shutter height, if one initially assumes that the shutter height is controlled via the mode "maximum desired incidence of light". Therefore two blind and slat positions are internally calculated: those for the current switching point and those for the next. The position in which the blind is more closed is then the valid position.

The positioning in intervals starts precisely when the following three conditions are satisfied:

If these three conditions are not satisfied, then the active bit (bActive) is set to FALSE, the shutter height to 0% and the slat angle to 0% in the positioning structure.

VAR_INPUT

eDataSecurityType      : E_HVACDataSecurityType;
bEnable                : BOOL;
stTimeAct              : TIMESTRUCT;
stBlindPositionTable   : ST_BARBlindPositionTable;

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: If this input is set to FALSE the positioning is inactive, i.e. the active bit (bActive) is reset in the positioning structure stSunblind of the type ST_BARSunblind and the function block itself remains in a standstill mode. If on the other hand the function block is activated, then the active bit is TRUE and the function block outputs its control values (uiShutterHeight, iLouvreAngle) in the positioning structure at the appropriate times.

stTimeAct: Entry of the current time in GMT (Greenwich Mean Time).

stBlindPositionTable: Table of 6 interpolation points, 4 of which are parameterizable, from which a blind position is then given in relation to the position of the sun by linear interpolation. Valid if ePositioningMode = ePosModeFixed (see enumerator E_BARPosMode). See FB_BARBlindPositionEntry for further description.

VAR_OUTPUT

stSunblind    : ST_BARSunblind;
bError        : BOOL;
udiErrorId    : UDINT;

stSunblind: Output structure of the blind positions, see ST_BARSunblind

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_BARSunProtectionEx 2:

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

uiPositioningInterval  : UINT;
lrDegreeOfLongitude    : LREAL;
lrDegreeOfLatitude     : LREAL;
lrFacadeOrientation    : LREAL;
lrFacadeAngle          : LREAL;
uiLouvreWidth          : UINT;
uiLouvreSpacing        : UINT;
uiFixedShutterHeight   : UINT;
uiMaxLightIncidence    : UINT;
uiWindowHeight         : UINT;
uiWindowDistanceFloor  : UINT;
ePositioningMode       : E_BARPOSMODE;

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.

uiPositioningInterval: Positioning interval in seconds – time interval between two outputs of blind positions. Valid range: 1s..7200s.

lrDegreeOfLongitude: Longitude in degrees. Valid range: -180°...180°.

lrDegreeOfLatitude: Latitude in degrees. Valid range: -90°..90°.

lrFacadeOrientation: Facade orientation in degrees:

In the northern hemisphere, the following applies for the facade orientation (looking out of the window):

Line of sight

Facade orientation

North

β=0°

East

β=90°

South

β=180°

West

β=270°

The following applies for the southern hemisphere:

Line of sight

Facade orientation

South

β=0°

East

β=90°

North

β=180°

West

β=270°

lrFacadeAngle: Facade inclination in degrees. See facade inclination.

uiLouvreWidth: Width of the slats in mm, see sketch.

uiLouvreSpacing: Slat spacing in mm, see sketch.

uiFixedShutterHeight: Fixed (constant) shutter height [0..100%]. Valid if ePositioningMode = ePosModeFixed (see enumerator E_BARPosMode).

uiMaxLightIncidence: Maximum desired incidence of light in mm measured from the outside of the wall (see Height adjustment). With the aid of the parameters uiWindowHeight and uiWindowDistanceFloor, a calculation is performed in relation to the position of the sun to determine how high the blind must be so that the incidence of light does not exceed the value uiMaxLightIncidence. Valid if ePositioningMode = ePosModeMaxIncidence (see enumerator E_BARPosMode).

uiWindowHeight: Window height in mm for the calculation of the shutter height if the mode "maximum desired incidence of light" is selected.

uiWindowDistanceFloor: Distance between the floor and the window sill in mm for the calculation of the shutter height if the mode "maximum desired incidence of light" is selected.

ePositioningMode: Selection of the positioning mode, see enumerator E_BARPosMode.

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