FB_BARBlindPositionEntry

This function block serves for the input of interpolation points for the function block FB_BARSunProtectionEx, if this should be operated in the height positioning mode with the help of a table, see E_BARPosMode.

FB_BARBlindPositionEntry 1:
FB_BARBlindPositionEntry

In addition to the operation modes "Fixed blind height" and "Maximum light incidence", the function block FB_BARSunProtectionEx also offers the possibility to control the blind height in relation to the position of the sun by means of table entries. By entering several interpolation points, the blind height relative to the respective sun position is calculated by linear interpolation. However, since incorrectly entered values can lead to malfunctions in FB_BARSunProtectionEx, this function block is to be preceded by the function block FB_BARBlindPositionEntry. Four interpolation points can be parameterized on this function block, whereby a missing entry is evaluated as a zero entry.
The function block does not sort the values entered independently, but instead ensures that the positions of the sun entered in the respective interpolation points are entered in ascending order. Unintentional erroneous entries are noticed faster as a result.
The values chosen for rSunElevation1... rSunElevation4 must be unique, for example, the following situation must be avoided:
[rSunElevation1 = 10 ; uiBlindPosition1 = 50] and simultaneously [rSunElevation2 = 10 ; uiBlindPosition2 = 30].
This would mean that there would be two different target values for one and the same value, which does not allow a unique functional correlation to be established.
In addition, the entries for the position of the sun and blind height must lie within the valid range. Mathematically this means that the following conditions must be satisfied:

The function block checks the values entered for these conditions and outputs an error code if they are not met. In addition, the output bValid is set to FALSE.
Furthermore the function block independently ensures that the boundary areas are filled out: internally, another interpolation point is set up at rSunElevation = 0 with uiBlindPosition1and another one above rSunElevation4 at rSunElevation = 90 with uiBlindPosition4. This ensures that a sensible target value exists for all valid input values 0 ≤rSunElevation≤ 90 without the user having to assign an entry for rSunElevation = 0 and rSunElevation = 90:

FB_BARBlindPositionEntry 2:

The actual number of interpolation points transferred to the function block FB_BARSunProtectionEx thus increases to 6, see ST_BARBlindPositionTable.

The interpolation of the values takes place in the glare protection function block.

VAR_INPUT

eDataSecurityType: E_HVACDataSecurityType;
bSetDefault      : BOOL;

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 internally released.

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_BARBlindPositionEntry 3:Example_PERSISTENT.zip

If eDataSecurityType:= eDataSecurityType_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.

bSetDefault: If the variable is TRUE, the default values of the VAR_IN_OUT variables are adopted.

VAR_OUTPUT

bValid              : BOOL;
uiErrorId           : UDINT;
stBlindPositionTable: ST_BARBlindPositionTable;

bValid: this output will be TRUE as long as the entries correspond to the criteria listed above.

uiErrorId: contains the error code, if the entries should not correspond to the criteria listed above. See error codes.

stBlindPositionTable : transfer structure of the interpolation points, see ST_BARBlindPositionTable.

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_BARBlindPositionEntry 4:Example_PERSISTENT.zip.

rSunElevation1   : REAL;;
uiBlindPosition1 : UINT;
rSunElevation2   : REAL;
uiBlindPosition2 : UINT;
rSunElevation3   : REAL;
uiBlindPosition3 : UINT;
rSunElevation4   : REAL;
uiBlindPosition4 : UINT;

rSunElevation1: position of the sun of the 1st interpolation point (0°..90°).

uiBlindPosition1: blind position (closing degree) of the 1st interpolation point (0%..100%).

rSunElevation2: position of the sun of the 2nd interpolation point (0°..90°).

uiBlindPosition2: blind position (closing degree) of the 2nd interpolation point (0%..100%).

rSunElevation3: position of the sun of the 3rd interpolation point (0°..90°).

uiBlindPosition3: blind position (closing degree) of the 3rd interpolation point (0%..100%).

rSunElevation4: position of the sun of the 4th interpolation point (0°..90°).

uiBlindPosition4: blind position (closing degree) of the 4th interpolation point (0%..100%).