FB_BARSunblindSwitch

With the help of this function block the blind controller FB_BARSunblindActuator or the roller blind controller FB_BARRollerblind can be controlled in manual operation mode. The connection takes place via the positioning telegram stSunblind either directly or with an additional priority controller.

FB_BARSunblindSwitch 1:
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

Operation

In manual mode, the function block controls the blind function block FB_BARSunblindActuator or the roller blind function block FB_BARRollerblind via the command inputs bSwitchUp and bSwitchDown; bSwitchUp has priority. The commands are passed on to the respective commands bManUp and bManDown of the positioning telegram. If a command input is activated for longer than the entered time uiSwitchOverTime (in ms), the corresponding control command latches. Activating a command input again releases this latch.

Linking to the blind function block

The manual control function block can be connected to the blind function block either directly or via an upstream priority controller FB_BARSunblindPrioritySwitch. The connection is made via the positioning telegram stSunblind.

Use of a priority controller:

FB_BARSunblindSwitch 2:

Direct connection:

FB_BARSunblindSwitch 3:

VAR_INPUT

eDataSecurityType: E_HVACDataSecurityType;
bEnable          : BOOL;
bSwitchUp        : BOOL;
bSwitchDown      : 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_BARSunblindSwitch 4: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 : the function block has no function if this input is FALSE. 0 is output for the position and the angle in the positioning telegram stSunblind - bManualMode and bActive are set to FALSE. For a connection with priority controller this means that another functionality takes over control of the blind. Conversely, a direct connection allows the blind to drive directly to the 0 position, i.e. fully up, since the actuator function block does not evaluate the bit bActive itself.

bSwitchUp: command input blind up.

bSwitchDown: command input blind down.

VAR_OUTPUT

stSunblind : ST_BARSunblind;
bActive    : BOOL;

stSunblind: positioning telegram, see ST_BARSunblind.

bActive : corresponds to the boolean value bActive in the blind telegram ST_BARSunblind and is solely used to indicate whether the function block sends an active telegram.

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_BARSunblindSwitch 5:Example_PERSISTENT.zip.

uiSwitchOverTime : UINT;

uiSwitchOverTime : time in milliseconds until the corresponding manual command in the positioning telegram stSunblind switches to latching mode, if the command input is activated permanently.