FB_BARSunblindScene

FB_BARSunblindScene 1:

This function block represents an extension of the manual operation FB_BARSunblindSwitch by a scene memory and a call function. The blind actuator FB_BARSunblindActuator or the roller shutter actuator FB_BARRollerblind can thus be controlled in manual operation mode and can also drive directly to previously saved positions (scenes). Up to 21 scenes can be saved.

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

Mode of operation

This function block controls the blind function blocks FB_BARSunblindActuator and FB_BARRollerBlind in manual mode via the command inputs bSwitchUp and bSwitchDown, wherein bSwitchUp takes priority. The commands are passed on to the respective commands bManUp and bManDown in the positioning telegram. If a command input is activated that is longer than the entered time uiSwitchOverTime (in ms), then the corresponding control command latches. Activating a command input again releases this latch.
A rising edge on bSaveScene saves the current position and louvre angle in the scene selected in usiSelectedScene. This procedure is possible at any time, even during active positioning. The selected scene is called with bInvokeScene, i.e. the saved position and angle values are driven to.

Linking to the blind function block

Like the "normal" manual control function block, FB_BARSunblindSwitch, the scene selection 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. Furthermore the scene function block requires the current positions from the blind function block for the reference blind:

Use of a priority controller:

FB_BARSunblindScene 2:

Direct connection:

FB_BARSunblindScene 3:

VAR_INPUT

eDataSecurityType  : E_HVACDataSecurityType;
bEnable            : BOOL;
usiSelectedScene   : USINT;
bSwitchUp          : BOOL;
bSwitchDown        : BOOL;
bInvokeScene       : BOOL;
bSaveScene         : BOOL;
uiSetpointPosition : UINT;
iSetpointAngle     : INT;

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: The function block has no function if this input is FALSE. 0 is output for both position and angle in the positioning telegram stSunblind - bManualMode and bActive are both 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.

usiSelectedScene : Selected scene, which is to be either stored (bSaveScene) or called (bInvokeScene).

bSwitchUp: Command input for blind up.

bSwitchDown: Command input for blind down.

bInvokeScene: Call selected scene.

bSaveScene: Save selected scene.

uiSetpointPosition: Setpoint position in % that is to be saved in the selected scene. Must be linked to the actual position of the actuator function block FB_BARSunblindActuator or FB_BARRollerblind for the reference blind/roller shutter in order to be able to save a position that was previously driven to manually.

iSetpointAngle: dto. Slat angle in degrees.

VAR_OUTPUT

stSunblind              : ST_BARSunblind;
bActive                 : BOOL;
uiPositionActScene      : UINT;
iAnglePositionActScene  : INT;
bError                  : BOOL;
udiErrorId              : UDINT;

stSunblind : Positioning telegram, see ST_BARSunblind.

bActive : Corresponds to the Boolean value bActive in the blind telegram ST_BARSunblind and serves merely to indicate whether the function block is sending an active telegram.

uiPositionActScene : Indicates the saved relative blind height position in % for the currently selected scene.

iAnglePositionActScene : dto. Slat angle in degrees.

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.

FB_BARSunblindScene 4:

If an error should occur, then this automatic function is deactivated and position and angle are set to 0. This means that if a priority controller is in use, another function with a lower priority (see Overview) automatically takes over control of the blind. In the case of a direct connection, conversely, the blind will drive to position/angle 0.

VAR_IN_OUT

uiSwitchOverTime : UINT;
arrBlindScenes   : ARRAY[0..20] OF ST_BARSunblindScene;

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.

uiSwitchOverTime : Time in milliseconds until the corresponding manual command in the positioning telegram stSunblind latches in the case of a continuous active command input.

arrBlindScenes : Table with the scene entries of the type ST_BARSunblindScene. Up to 21 scenes can be saved: 0..20.

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