FB_BA_SunPrtc

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

FB_BA_SunPrtc 1:

Functional description

Glare protection is realized through variation of the slat angle and positioning of the blind height.

The slat angle is set as a function of the sun position such that direct glare is prevented, while letting as much natural light through as possible.

Three different operation modes are available for varying the blind height:

  1. When sun protection is active, the blind moves to a fixed height. The height value is specified with the variable lrFixPos.
  2. The blind position is varied as a function of the sun position. The position is specified in the table (stBldPosTab). See also description of FB_BA_BldPosEntry.
  3. The vertical blind position is calculated based on the window geometry such that the sun's rays reach a specified depth in the room. The incidence depth of the sun's rays is defined with the variable lrMaxLgtIndc.

In order to avoid excessive repositioning of the slat angle, the variable udiPosIntval can be used to specify a time interval, within which the slat angle is not adjusted. In order to avoid glare, the angle is always changed sufficiently for the respective time interval.

The following conditions must be met for positioning the blind and setting the slat angle.
1. The input bEnable must be TRUE.
2. The sun must have risen. (elevation > 0)
3. The function block is parameterized correctly (bErr = FALSE)

The function block FB_BA_SunPrtc enables glare protection in two ways, which work 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 stSunBld. Of course, the output does not take place continuously, since a constant blind movement would be perceived as distracting. At the input udiPosIntval it is possible to set in minutes the interval at which new position values are to be output.
However, the shading criteria must always be fulfilled between two positioning times: no direct light may pass through the slats and the desired light incidence through the blind height must remain limited, assuming initially that the blind height is controlled via the "maximum desired light incidence" mode. Therefore, two blind and slat positions are calculated internally: the one for the current switching point and the one for the next switching point. 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 (bActv) is set to FALSE, the blind height to 0% and the slat angle to 0% in the positioning structure.

Error handling

The following invalid inputs were detected:

Always:

Only if "fixed blind height" positioning is selected - ePosMod=ePosModFix:

Only if "maximum light incidence" is selected - ePosMod=ePosModMaxIndc:

Only if "maximum light incidence" is selected - ePosMod=ePosModMaxIndc.

Inputs/outputs

VAR_INPUT

bEn           : BOOL;
stUTC         : TIMESTRUCT;
udiPosIntval  : UDINT;
lrDegLngd     : LREAL;
lrDegLatd     : LREAL;
lrFcdOrtn     : LREAL;
lrFcdAngl     : LREAL;
lrLamWdth     : LREAL;
lrLamDstc     : LREAL;
lrFixPos      : LREAL;
lrMaxLgtIndc  : LREAL;
lrWdwHght     : LREAL;
lrDstcWdwFlr  : LREAL;
stBldPosTab   : ST_BA_BldPosTab;
ePosMod       : E_BA_PosMod;

bEn: if this input is set to FALSE, the positioning is inactive, i.e. the active bit (bActv) is reset in the positioning structure stSunBld of the type ST_BA_SunBld 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 (rPos, rAngl) in the positioning structure at the appropriate times.

stUTC: input of current time as coordinated universal time (UTC - Universal Time Coordinated, previously referred to as GMT, Greenwich Mean Time). The function block FB_BA_GetTime can be used to read this time from a target system.

FB_BA_SunPrtc 2:

A jump of more than 300 seconds leads to immediate repositioning, if the blind is in the sun and glare protection is active, based on the above criteria. This functionality was added to ensure a reproducible program execution.

udiPosIntval: positioning interval in minutes - time between two blind position outputs. Valid range: 1 min...720 min.

lrDegLngd: longitude [°]. Valid range: - 180°...180°

lrDegLatd: latitude [°]. Valid range: - 90°...90°

lrFcdOrtn: facade orientation [°]

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°

lrFcdAngl: facade inclination [°]. See facade inclination

lrLamWdth: width of the slats in mm, see sketch

lrLamDstc: slat spacing in mm, see sketch

lrFixPos: fixed (constant) blind height [0…100 %]. Applies if ePosMod = ePosModFix (see enumerator E_BA_PosMod).

lrMaxLgtIndc: maximum desired incidence of light in mm measured from the outside of the wall (see Height adjustment). With the aid of the parameters lrWdwHght and lrDstcWdwFlr, 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 lrMaxLgtIndc. Valid if ePosMod = ePosModeMaxIncidence (see enumerator E_BA_PosMod).

lrWdwHght: window height in mm for the calculation of the blind height if the mode "maximum desired incidence of light" is selected.

lrDstcWdwFlr: distance between the floor and the window sill in mm for the calculation of the blind height if the mode "maximum desired incidence of light" is selected.

stBldPosTab: 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. Applies if ePosMod = ePosModFix (see enumerator E_BA_PosMod). For a more detailed description please refer to FB_BA_BldPosEntry.

ePosMod: selection of the positioning mode, see enumerator E_BA_PosMod.

VAR_OUTPUT

stSunBld    : ST_BA_SunBld;
bActv       : BOOL;
bErr        : BOOL;
udiErrorId  : UDINT;
udiErrArg   : UDINT;

stSunBld: Output structure of the blind positions, see ST_BA_SunBld

bActv: The function block is in active state, i.e. no error is pending, the function block is enabled, and the sun position is in the specified facade area (the facade is sunlit).

bErr: This output is switched to TRUE if the parameters entered are erroneous.

udiErrId / udiErrArg: Contains the error number and the error argument. See Error codes.

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

Requirements

Development environment

Target system

required library

required supplement

TwinCAT 2.11 R3/x64

PC/CX

TcBA library from V1.0.0

TS8040 | TwinCAT Building Automation from V1.0.0