FB_ScenesVenetianBlind

FB_ScenesVenetianBlind 1:

Description

Use of the function block

This function block is intended for the management of blind scenes. The function block is enabled via the bEnable input. The loading of the saved scenes is started by a rising edge at the bEnable input. The input must remain TRUE until the operation is completed. The values of the scenes are saved non-volatile in the TwinCAT Boot directory as a *.bin file. The last data status is saved in a *.bak file as a backup.

Saving a scene

The values of the inputs nActualValueBlinding_1..7 are saved in the respective scene by a rising edge at the input bSaveScene_1...16.

Loading scenes

The saved values are output at the output nBlindValue_1..7 by a rising edge at the input bInvokeScene_1..16. Furthermore, a rising edge is generated at the output bSetBlindValue_1..7 for one PLC cycle.

Note: This functionblock is only available in the PC-based version of the library.

VAR_INPUT

bEnable                : BOOL;
bInvokeScene_1         : BOOL;
bInvokeScene_2         : BOOL;
bInvokeScene_4         : BOOL;
bInvokeScene_5         : BOOL;
bInvokeScene_6         : BOOL;
bInvokeScene_7         : BOOL;
bInvokeScene_8         : BOOL;
bInvokeScene_9         : BOOL;
bInvokeScene_10        : BOOL;
bInvokeScene_11        : BOOL;
bInvokeScene_12        : BOOL;
bInvokeScene_13        : BOOL;
bInvokeScene_14        : BOOL;
bInvokeScene_15        : BOOL;
bInvokeScene_16        : BOOL;
bSaveScene_1           : BOOL;
bSaveScene_2           : BOOL;
bSaveScene_3           : BOOL;
bSaveScene_4           : BOOL;
bSaveScene_5           : BOOL;
bSaveScene_6           : BOOL;
bSaveScene_7           : BOOL;
bSaveScene_8           : BOOL;
bSaveScene_9           : BOOL;
bSaveScene_10          : BOOL;
bSaveScene_11          : BOOL;
bSaveScene_12          : BOOL;
bSaveScene_13          : BOOL;
bSaveScene_14          : BOOL;
bSaveScene_15          : BOOL;
bSaveScene_16          : BOOL;
nActualValueBlinding_1 : UINT;
nActualValueBlinding_2 : USINT;
nActualValueBlinding_3 : USINT;
nActualValueBlinding_4 : USINT;
nActualValueBlinding_5 : USINT;
nActualValueBlinding_6 : USINT;
nActualValueBlinding_7 : USINT;
sFile                  : STRING;
nOptions               : DWORD;

bEnable: enables the function block.

bInvokeScene_1..16: calls the respective scene.

bSaveScene_1..16: saves the current analog value nActualValueBlinding_1..14 in the respective scene.

nActualValueBlinding_1..7: current control value of the respective blind. Return value from the blind function block FB_VenetianBlindEx().

sFile: file name (without path and file extension) for saving the scenes. The file name must be unique in the entire project. If several instances of the function blocks FB_ScenesLighting() or FB_ScenesVenetianBlind() are created, then each instance must use a different file name. The file is always saved to the TwinCAT Boot directory and is given the extension .bin. Example: 'ControlPanelA'.

nOptions: reserved for future developments.

VAR_OUTPUT

bSetBlindValue_1       : BOOL;
nBlindValue_1          : USINT;
bSetBlindValue_2       : BOOL;
nBlindValue_2          : USINT;
bSetBlindValue_3       : BOOL;
nBlindValue_3          : USINT;
bSetBlindValue_4       : BOOL;
nBlindValue_4          : USINT;
bSetBlindValue_5       : BOOL;
nBlindValue_5          : USINT;
bSetBlindValue_6       : BOOL;
nBlindValue_6          : USINT;
bSetBlindValue_7       : BOOL;
nBlindValue_7          : USINT;
bInit                  : BOOL;
bError                 : BOOL;
nErrorId               : UDINT;

bSetBlindValue_1..7: output with the edge for the input bPosition of the function block FB_VenetianBlindEx().

nBlindValue_1..7: output with the value for the input nSetPosition of the function block FB_VenetianBlindEx().

bInit: this output goes TRUE as soon as the initialisation of the function block is complete.

bError: this output is set to TRUE as soon as an error is detected during execution. The error code is contained in nErrorId.

nErrorId: contains the error code as soon as bError goes TRUE. See Error codes.