FB_BA_ShdCorr

FB_BA_ShdCorr 1:

The function block FB_BA_ShdCorr is used to assess the shading of a group of windows on a facade.

The function block FB_BA_ShdCorr calculates whether a window group lies in the shadow of surrounding objects. The result, which is output at the output bGrpNotShdd, can be used to assess whether sun protection makes sense for this window group.
The function block thereby accesses two lists, which are to be defined:

On the basis of the facade orientation (fFcdOrtn), the direction of the sun (fAzm) and the sun elevation (fElv), a calculation can be performed for each corner of a window to check whether this lies in a shaded area. A window group is considered to be completely shaded if all corners are shaded.

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 function block performs its calculations only if the sun is actually shining on the facade. Considering the drawing presented in the introduction, this is the case if:

Facade orientation < azimuth angle < facade orientation + 180°

FB_BA_ShdCorr 2:

In addition, a calculation is also not required, if the sun has not yet risen, i.e. the sun elevation is below 0°. In both cases the output bFcdSunlit is set to FALSE.

The situation is different for the southern hemisphere. The following applies to the facade orientation (looking out the window):

Viewing direction

Facade orientation

South

β=0°

East

β=90°

North

β=180°

West

β=270°

The internal calculation or the relationship between facade and sunbeam also changes:

FB_BA_ShdCorr 3:

To distinguish between the situation in the northern and southern hemisphere, set the input parameter bSouth to FALSE (northern hemisphere) or TRUE (southern hemisphere)

FB_BA_ShdCorr 4: Inputs

VAR_INPUT
  tTiActl   : TIMESTRUCT;
  fFcdOrtn  : REAL;
  fAzm      : REAL;
  fElv      : REAL;
  nGrpID    : DINT;
  bSouth    : BOOL;
  aShdObj   : ARRAY[1..BA_Param.nSunPrt_MaxShdObj] OF ST_BA_ShdObj;
END_VAR

Name

Type

Description

tTiActl

TIMESTRUCT

Input of the current time - local time in this case, since this time takes into account the shaded months. If the UTC time (or GMT) is used, the month may change in the middle of the day, depending on the location on the earth.

fFcdOrtn

REAL

Facade orientation, see illustration above.

fAzm

REAL

Direction of the sun at the time of observation [°]

fElv

REAL

Sun elevation at the time of observation [°]

nGrpID

UDINT

Window group regarded. The group 0 is reserved here for unused window elements (see FB_BA_FcdElemEntry). A 0-entry would lead to an error output (bErr=TRUE). The function block is then not executed any further and bGrpNotShdd is set to FALSE.

bSouth

BOOL

FALSE: Calculations refer to conditions in the northern hemisphere -
TRUE: in the southern hemisphere

aShdObj

ARRAY OF ST_BA_ShdObj

List of shading objects.

FB_BA_ShdCorr 5: / FB_BA_ShdCorr 6: Inputs/Outputs

VAR_IN_OUT
  aFcdElem : ARRAY[1..BA_Param.nSunPrt_MaxColumnFcd, 1..BA_Param.nSunPrt_MaxRowFcd] OF ST_BA_FcdElem;
END_VAR

Name

Type

Description

aFcdElem

ARRAY OF ST_BA_FcdElem

List of facade elements

FB_BA_ShdCorr 7: Outputs

VAR_OUTPUT
  bGrpNotShdd    : BOOL;
  bFcdSunlit     : BOOL;
  bErr           : BOOL;
  sErrDescr      : T_MAXSTRING;
END_VAR

Name

Type

Description

bGrpNotShdd

BOOL

Is TRUE as long as the window group is not calculated as shaded.

bFcdSunlit

BOOL

This output is set to TRUE if the sun is shining on the facade. See description above.

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: Index error window group (group of facade elements): Index is less than or equal to 0.

02: Error: A facade element is invalid.

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.22

Tc3_BA2 from v5.2.5.0