FB_BARBlindPositionEntry

FB_BARBlindPositionEntry 1:

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.

In addition to the operation modes "Fixed shutter 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 shutter 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 selected values for rSunElevation1 .. rSunElevation4 must also be unique; for example, they may not be:
[rSunElevation1 = 10; uiBlindPosition1 = 50] and at the same time [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.
On top of that the entries for the position of the sun and shutter 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 satisfied. In addition, the output bValid is set to FALSE.
Furthermore the function block independently ensures that the boundary areas are filled out: Internally a further interpolation point is setup at rSunElevation = 0 with uiBlindPosition1 and a further 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 block.

VAR_INPUT

eDataSecurityType  : E_HVACDataSecurityType;
bSetDefault        : BOOL;

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

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

lrSunElevation1   : REAL;;
uiBlindPosition1 : UINT;
lrSunElevation2   : REAL;
uiBlindPosition2 : UINT;
lrSunElevation3   : REAL;
uiBlindPosition3 : UINT;
lrSunElevation4   : REAL;
uiBlindPosition4 : UINT;

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

lrSunElevation1: Sun position at the first interpolation point (0°..90°).

uiBlindPosition1: Blind position (degree of closure) at the first interpolation point (0%..100%).

lrSunElevation2: Sun position at the second interpolation point (0°..90°).

uiBlindPosition2: Blind position (degree of closure) at the second interpolation point (0%..100%).

lrSunElevation3: Sun position at the third interpolation point (0°..90°).

uiBlindPosition3: Blind position (degree of closure) at the third interpolation point (0%..100%).

lrSunElevation4: Sun position at the fourth interpolation point (0°..90°).

uiBlindPosition4: Blind position (degree of closure) at the fourth interpolation point (0%..100%).

Requirements

Development environment

required library

required function

TwinCAT 3.1 build 4022.16 or higher

Tc2_HVAC V3.3.1.0

TF8000 | TC3 HVAC V1.0.0.0