FB_BA_SunPrtc

FB_BA_SunPrtc 1:

The function block FB_BA_SunPrtc is used for glare protection with the aid of a slatted blind.

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 fFixPos.
  2. The blind position is varied as a function of the position of the sun. The position is specified in the table (ST_BA_BldPosTab). See also description of FB_BA_BldPosEntry.
  3. The high of the blind 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 fMaxLgtIndc.

In order to avoid excessive repositioning of the slat angle, the variable nPosIntval [min] 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.

FB_BA_SunPrtc 2: Inputs

VAR_INPUT
  bEn               : BOOL;
  tUTC              : TIMESTRUCT;
  nPosIntval        : UDINT;
  fDegLngd          : REAL;
  fDegLatd          : REAL;
  fFcdOrtn          : REAL;
  fFcdAngl          : REAL;
  fLamWdth          : REAL;
  fLamDstc          : REAL;
  fFixPos           : REAL;
  fMaxLgtIndc       : REAL;
  fWdwHght          : REAL;
  fDstcWdwFlr       : REAL;
  stBldPosTab       : ST_BA_BldPosTab;
  ePosMod           : E_BA_PosMod := E_BA_PosMod.eFix;
END_VAR

Name

Type

Description

bEn

BOOL

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 (fPos, fAngl) in the positioning structure at the appropriate times.

stUTC

TIMESTRUCT

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

FB_BA_SunPrtc 3:

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.

Name

Type

Description

nPosIntval

UDINT

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

fDegLngd

REAL

Longitude [°]. Valid range: - 180°...180°.

fDegLatd

REAL

Latitude [°]. Valid range: - 90°...90°.

fFcdOrtn

REAL

Facade orientation [°].

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

Viewing direction

Facade orientation

North

β=0°

East

β=90°

South

β=180°

West

β=270°

The following applies for the southern hemisphere:

Viewing direction

Facade orientation

South

β=0°

East

β=90°

North

β=180°

West

β=270°

Name

Type

Description

fFcdAngl

REAL

Facade inclination [°] (see Facade inclination).

fLamWdth

REAL

Width of the slats in mm (see sketch).

fLamDstc

REAL

Slat spacing in mm (see sketch).

fFixPos

REAL

Fixed (constant) blind height [0...100%]. Applies if ePosMod = ePosModFix (see E_BA_PosMod).

fMaxLgtIndc

REAL

Maximum desired light incidence in mm measured from the outside of the wall (see height adjustment). The parameters fWdwHght and fDstcWdwFlr are used to calculate how high the blinds must be, depending on the position of the sun, such that the incidence of light does not exceed the value fMaxLgtIndc. Applies if ePosMod = ePosModeMaxIncidence (see E_BA_PosMod).

fWdwHght

REAL

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

fDstcWdwFlr

REAL

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

ST_BA_BldPosTab

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 E_BA_PosMod). For a more detailed description please refer to FB_BA_BldPosEntry.

ePosMo

E_BA_PosMod

Selection of the positioning mode

FB_BA_SunPrtc 4: Inputs CONSTANT PERSISTENT

VAR_INPUT CONSTANT PERSISTENT
  ePrio        : E_BA_SunBldPrio := E_BA_SunBldPrio.eSunProtection;
  fAnglLmtUp   : REAL;
END_VAR

Name

Type

Description

ePrio

E_BA_SunBldPrio

Priority of the active telegram.

fAnglLmtUp

REAL

Slats do not need to be opened above 0°.

FB_BA_SunPrtc 5: Outputs

VAR_OUTPUT
  stSunBld     : ST_BA_SunBld;
  bActv        : BOOL;
  bErr         : BOOL;
  sErrorDescr  : T_MAXSTRING;
END_VAR

Name

Type

Description

stSunBld

ST_BA_SunBld

Output telegram, for the position and angle of the lamella.

bActv

BOOL

Corresponds to the boolean value bActv in the blind telegram ST_BA_SunBld and is solely used to indicate whether the function block sends an active telegram.

bErr

BOOL

In case of a fault, e.g. if warning stages are active, this output is set to TRUE.

sErrDescr

T_MAXSTRING

Contains the error description.

Error description

01: Error: The duration of the positioning interval is less than or equal to zero, or it exceeds 720 min.

02: Error: The value entered for the longitude is not in the valid range of -180°...180°.

03: Error: The value entered for the latitude is not in the valid range of -90°...90°.

04: Error: The value entered for the facade inclination fFcdAngl is outside the valid range of -90°..90°.

05: Error: The value for the slat spacing (fLamDstc) is greater than or equal to the value for the slat width (fLamWdth). This does not represent a "valid" blind, since the slats cannot close fully. Mathematically, this would lead to errors.

06: Error: The value entered for the slat width fLamWdth is zero.

07: Error: The value entered for the slat spacing fLamDstc is zero.

08: Error: The value entered for the fixed blind height (fFixPos) is greater than 100 or less than 0. At the same time, positioning "fixed blind height" is selected - ePosMod = ePosModFix.

09: Error: The "Values valid" bit (bVld) in the stBldPosTab positioning table is not set - invalid values, see FB_BA_BldPosEntry. At the same time, "Table" positioning is selected – ePosMod = ePosModTab.

10: Error: The value entered for the maximum required light incidence fMaxLgtIndc is less than or equal to zero. At the same time, "maximum light incidence" is selected – ePosMod = ePosModMaxIndc.

11: Error: The value entered for the window height fWdwHght is less than or equal to zero. At the same time, "maximum light incidence" is selected – ePosMod = ePosModMaxIndc.

12: Error: The distance between lower window edge and floor fDstcWdwFlr that was entered is less than zero. At the same time, "maximum light incidence" is selected – ePosMod = ePosModMaxIndc.

13: Error: An invalid positioning mode is entered at input ePosMod.

FB_BA_SunPrtc 6:

If an error occurs, this automatic control is disabled and the 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

Required PLC library

TwinCAT from v3.1.4024.22

Tc3_BA2 from v5.2.5.0