FB_BA_ShdCorr
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:
- The parameters that describe the shading elements that are relevant to the facade on which the window group is located. This list of shading objects is used as input variable aShdObj for the function block, since the information is read only.
- The data of the elements (window) of the facade in which the group to be regarded is located. This list of facade elements is accessed via the IN/OUT variable aFcdElem, since not only the window coordinates are read, but the function block FB_BA_ShdCorr also stores the shading information for each window corner in this list. In this way, the information can also be used in other parts of the application program.
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°
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:
To distinguish between the situation in the northern and southern hemisphere, set the input parameter bSouth to FALSE (northern hemisphere) or TRUE (southern hemisphere)
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 - |
aShdObj | ARRAY OF ST_BA_ShdObj |
/ 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 |
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 |