FB_BA_SunBldScn
This function block represents an extension of the manual controller FB_BA_SunBldSwi by a scene memory and a call function. The blind control FB_BA_SunBldActr or the roller blind control FB_BA_RolBldActr can be active in manual mode and also directly target previously stored positions (scenes). Up to 21 scenes can be saved.
Functional description
Structure of the blind positioning telegram stSunBld
TYPE ST_BA_SunBld:
STRUCT
lrPos : LREAL;
lrAngl : LREAL;
bManUp : BOOL;
bManDwn : BOOL;
bManMod : BOOL;
bActv : BOOL;
END_STRUCT
END_TYPE
Operation
In manual mode, the function block controls the blind function block FB_BA_SunBldActr or the roller blind function block FB_BA_RolBldActr via the command inputs bUp and bDwn; bUp has priority. The commands are passed on to the respective commands bManUp and bManDwn of the positioning telegram. If a command input is activated for longer than the entered time udiSwiOvrTi [ms], the corresponding control command latches. Activating a command input again clears this latching.
A rising edge at bSavScn saves the current position and the slat angle in the scene selected at udiSlcdScn. This procedure is possible at any time, even during active positioning. With bClScn the selected scene is called up, i.e. the stored values of position and angle are driven to.
If the function block is activated by bEn = TRUE, bit bActv and bManMod is set immediately in the positioning telegram. The function block uses this to notify a priority switch (FB_BA_SunBldPrioSwi4 or FB_BA_SunBldPrioSwi8) of its priority over lower priorities. The setting of bManMod indicates to the actuator function block that no automatic positioning command has to be executed.
Linking to the blind function block
Like the "normal" manual mode function block FB_BA_SunBldSwi, the scene selection function block can be connected either via an upstream priority control FB_BA_SunBldPrioSwi4 or FB_BA_SunBldPrioSwi8, or directly via the blind function block. The link is based on the positioning telegram stSunBld. Furthermore the scene function block requires the current positions from the blind function block for the reference blind:
Use of a priority controller:
Direct connection:
Inputs/outputs
VAR_INPUT
bEn : BOOL;
bUp : BOOL;
bDwn : BOOL;
udiSwiOvrTi : UDINT;
udiSlcdScn : UDINT;
bClScn : BOOL;
bSavScn : BOOL;
lrSpPos : LREAL;
lrSpAngl : LREAL;
bEn: the function block has no function if this input is FALSE. 0 is output for the position and the angle in the positioning telegram stSunBld - bManualMode and bActv 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 bActv itself.
bUp: command input blind up
bDwn: command input blind down
udiSwiOvrTi: time [ms] until the corresponding manual command in the positioning telegram stSunBld switches to latching mode, if the command input is activated permanently.
udiSlcdScn: selected scene which should either be saved (bSaveScene) or called (bInvokeScene).
bClScn: call selected scene
bSavScn: save selected scene
lrSpPos: set position [%] that is to be saved in the selected scene. This must be linked to the actual position of the actuator function block FB_BA_SunBldActr or FB_BA_RolBldActr of the reference blind/roller blind, in order to be able to save a position that was previously approached manually.
lrSpAngl: ditto slat angle [°]
VAR_IN_OUT
arrSunBldScn : ARRAY[0..cMaxSunBldScn] OF ST_BA_SunBldScn;
arrSunBldScn: Table with the scene entries of the type ST_BA_SunBldScn. Up to 21 scenes can be stored (0..20).
VAR_OUTPUT
stSunBld : ST_BA_SunBld;
bActv : BOOL;
lrActlScnPos : LREAL;
lrActlScnAngl : LREAL;
bErr : BOOL;
udiErrId : UDINT;
udiErrArg : UDINT;
stSunBld: positioning telegram, see ST_BA_SunBld
bActv: corresponds to the boolean value bActv in the blind telegram ST_BA_SunBld and is solely used to indicate whether the function block sends an active telegram.
lrActlScnPos: indicates the saved relative blind height position [%] for the currently selected scene.
lrActlScnAngl: ditto slat angle [°]
bErr: this output is switched to TRUE if the parameters entered are erroneous.
udiErrId / udiErrArg: contains the error number and the error argument. See error codes.
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. |
Requirements
Development environment | Target system | required library | required supplement |
---|---|---|---|
TwinCAT 2.11 R3/x64 | PC/CX | TcBA library from V1.0.0 | TS8040 | TwinCAT Building Automation from V1.0.0 |