FB_DALIV2SwapShortAddressList

FB_DALIV2SwapShortAddressList 1:

The short addresses of several ballasts can be swapped using this function block. In order to do this, however, it is necessary that a free, unused short address is present in the DALI line.

In the parameter arrSwapShortAddressList, a list of the ballasts whose short addresses are to be changed is transferred. The index of the structure thereby corresponds to the short address of the ballast. The element nNewShortAddress contains the new short address. bShortAddressValid must test to TRUE in order that the short address of the respective ballast will be changed. Applying a rising edge to the bStart input starts the block, and the bBusy output goes TRUE. Depending on the chosen options ( nOptions parameter), all lamps will be set to the value MIN LEVEL. The elements of the output arrSwapedShortAddresses are reset. If the new short address is set for a ballast, the corresponding element in the output arrSwapedShortAddresses is set to TRUE. If the option DALIV2_OPTION_OPTICAL_FEEDBACK is active, the lamp will in addition be set to the value MAX LEVEL.

VAR_INPUT

bStart            : BOOL;
bCancel            : BOOL;
nFreeShortAddress  : BYTE;
nOptions           : DWORD := DALIV2_OPTION_OPTICAL_FEEDBACK;

bStart: The block is activated by a rising edge at this input.

bCancel: A rising edge at this input will deactivate the block and hence abort the swapping of the short addresses.

nFreeShortAddress: Free short address (0 – 63).

nOptions: Options for swapping short addresses (see table). The individual constants must be linked with OR operators.

Constants

Description

DALIV2_OPTION_OPTICAL_FEEDBACK

Before swapping the short addresses, all ballasts are set to MIN LEVEL. After assigning the new short address, the brightness of the respective ballast will be changed to MAX LEVEL

VAR_OUTPUT

bBusy                    : BOOL;
bError                   : BOOL;
nErrorId                 : UDINT;
arrSwapedShortAddresses  : ARRAY[0..63] OF BOOL;

bBusy: When the block is activated the output is set, and it remains active until execution of the command has been completed.

bError: This output is switched to TRUE if an error occurs during the execution of a command. The command-specific error code is contained in nErrorId. Is reset to FALSE by the execution of an instruction at the inputs.

nErrorId: Contains the command-specific error code of the most recently executed command. Is reset to 0 by the execution of an instruction at the inputs. See Error codes.

arrSwapedShortAddresses: If the new short address has been set for a ballast, the corresponding element will be set in the array. The array index reflects the short address of the ballast.

VAR_IN_OUT

arrSwapShortAddressList  : ARRAY[0.. 63] OF ST_DALIV2SwapShortAddressList;
stCommandBuffer          : ST_DALIV2CommandBuffer;

arrSwapShortAddressList: A reference to the list containing the short addresses to be swapped.

stCommandBuffer: A reference to the structure for communication with the FB_DALIV2Communication() (KL6811) or FB_KL6821Communication() (KL6821) block.