FB_BARWithinRangeAzimuth

This function block checks whether the current azimuth angle (horizontal position of the sun) lies within the limits entered. As can be seen in the overview, the function block provides an additionally evaluation as to whether the sun protection of a window group should be activated. Therefore the observations in the remainder of the text always apply to one window group.

FB_BARWithinRangeAzimuth 1:

The sun incidence azimuth angle on a smooth facade will always be facade orientation-90°... facade orientation+90°.

FB_BARWithinRangeAzimuth 2:

If the facade has lateral projections, however, this range is limited. This limitation can be checked with the help of this function block. However, the position of the window group on the facade also plays a role. If it lies centrally, this gives rise to the following situation (the values are only examples):

FB_BARWithinRangeAzimuth 3:

The values change for a group at the edge:

FB_BARWithinRangeAzimuth 4:

The beginning of the range rBeginRange may thereby be larger than the end rEndRange; it is then regarded beyond 0°:

Sample:

lrAzimuth

10.0°

lrBeginRange

280.0°

lrEndRange

20.0°

bOut

TRUE


However, the range regarded may not be greater than 180° or equal to 0° – this would be unrealistic. Such entries result in an error on the output bError – the test output bOut is then additionally set to FALSE.

VAR_INPUT

eDataSecurityType: E_HVACDataSecurityType;
lrAzimuth        : LREAL;

eDataSecurityType:if eDataSecurityType:= eDataSecurityType_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: FB_BARWithinRangeAzimuth 5: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.

lrAzimuth: current azimuth angle.

VAR_OUTPUT

bOut       : BOOL;
bError     : BOOL;
udiErrorId : UDINT;

bOut: binary delayed output of the threshold switch.

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.

VAR_IN_OUT

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 declared as input variables, they would not be able to write a reference variable.
Application example: FB_BARWithinRangeAzimuth 6:Example_PERSISTENT.zip.

lrBeginRange : LREAL;
lrEndRange   : LREAL;

lrBeginRange: begin of range in degrees.

lrEndRange: end of range in degrees.