FB_BARRollerBlind

FB_BARRollerBlind 1:

This function block is used for positioning a roller blind via two outputs: blind up and blind down. The blind can be driven to any desired position with the position telegram stSunblind. In addition, the positioning telegram stSunblind offers manual commands, which can be used to move the blind to particular positions. These manual commands are controlled by the function block FB_BARSunblindSwitch.

Structure of the blind positioning telegram stSunblind.

TYPE ST_BARSunblind:
STRUCT
     uiPosition      : UINT;
     iAngle          : INT;
     bManUp          : BOOL;
     bManDown        : BOOL;
     bManualMode     : BOOL;
     bActive         : BOOL;
END_STRUCT
END_TYPE

The current height position and the slat angle are not read in by an additional encoder, but determined internally by the travel time of the blind.
Allowance is made for the different driving characteristics through the two different runtime parameters udiTotalTimeUp (upward runtime of the blind in ms) and udiTotalTimeDown (downward runtime of the blind in ms).

Functioning

The function block fundamentally controls the blind via the information from the positioning telegram stSunblind. If automatic mode is active (bManualMode=FALSE), then the current position is always driven to, wherein changes are immediately accounted for. In manual mode (bManualMode=TRUE) the commands bManUp and bManDown control the blind.

Referencing

Secure referencing is ensured if the blind is driven upward for longer than its complete drive-up time. The position is then in any case "0". Since blind positioning without an encoder is naturally always susceptible to error, it is important to automatically reference as often as possible: each time the "0" position is to be driven to, the blind initially drives upward quite normally with continuous position calculation. Once the calculated position value of 0% has been reached, the output bBlindUp is kept active until another complete drive-up time + 5 s has elapsed.
For reasons of flexibility there are now two possibilities to interrupt the referencing procedure: Until the calculated 0% position has been reached, a change of position is still accepted and executed; after reaching this 0% position, the manual command "down" can still move the blind differently. These two sensible limitations make it necessary for the user to ensure that the blind is securely referenced as often as possible.

VAR_INPUT

eDataSecurityType  : E_HVACDataSecurityType;
bEnable            : BOOL;
stSunblind         : ST_BARSunblind;

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.

bEnable: Enable input for the function block. As long as this input is TRUE, the actuator function block accepts and executes commands as described above. A FALSE signal on this input resets the control outputs bBlindUp and bBlindDown and the function block remains in a state of rest.

stSunblind: Positioning telegram, see ST_BARSunblind.

VAR_OUTPUT

bBlindUp       : BOOL;
bBlindDown     : BOOL;
uiActPosition  : UINT;
bReferencing   : BOOL;
bBusy          : BOOL;
bError         : BOOL;
udiErrorId     : UDINT;

bBlindUp: control output for blind up.

bBlindDown: control output for blind down.

uiActPosition: current position in percent.

bReferencing: the blind is in the reference-process, which means, that the output bBlindUp will be set for the complete drive-up time + 5 s. Only the manual command "down" can move the blind in the opposite direction an terminate the reference-mode.

bBusy: a positioning or a referencing procedure is in progress.

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

udiTotalTimeUp      : UDINT;
udiTotalTimeDown    : UDINT;

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.

udiTotalTimeUp: Complete time for driving up in ms.

udiTotalTimeDown: Complete time for driving down in ms.

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