FB_DALIV2AddressingRandomAddressing

FB_DALIV2AddressingRandomAddressing 1:

This function block addresses the ballasts in random order. The user has no influence over which short address is assigned to which ballast. Short addresses are allocated in ascending order.

Applying a rising edge to the bStart input starts the block, and the bBusy output goes TRUE. Depending on the selected options (parameter nOptions) the group associations and scenarios are subsequently deleted. The block now addresses all ballasts independently. The arrAddressedDevices output variable provides information about which ballasts have already been allocated a short address. Once all ballasts have been addressed, the bBusy output switches back to FALSE. Addressing can be aborted through a rising edge at input bCancel. Processing this function block can take several minutes, depending on how many ballasts are attached.

VAR_INPUT

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

bStart: A rising edge at this input activates the block, thereby starting the addressing sequence.

bCancel: A rising edge at this input deactivates the block, thereby interrupting the addressing sequence.

nStartWithShortAddress: Short address allocated to the first ballast (0 ... 63).

nOptions: Options for addressing the ballasts (see table). The individual constants must be linked with OR operators.

Constant

Description

DALIV2_OPTION_COMPLETE_NEW_INSTALLATION

All ballasts are re-addressed, including ballasts that already have a short address.

DALIV2_OPTION_DELETE_ALL_GROUP_ASSIGNMENTS

Prior to addressing, the group associations are deleted for any ballasts, even those which may not be addressed by the addressing method (see variables GROUP 0-7 and GROUP 8-15)

DALIV2_OPTION_DELETE_ALL_SCENE_ASSIGNMENTS

Prior to addressing, the scenes are deleted for any ballasts, even those which may not be addressed by the addressing method (see variables SCENE 0 to SCENE 15)

DALIV2_OPTION_OPTICAL_FEEDBACK

Prior to addressing, all ballasts are set to MIN LEVEL Newly addressed ballasts are assigned MAX LEVEL

DALIV2_OPTION_WITHOUT_RANDOMISE

The RANDOMISE command is not called before the addressing sequence. This means that all ballasts retain their existing random address (RANDOM ADDRESS)

VAR_OUTPUT

bBusy                  : BOOL;
bError                 : BOOL;
nErrorId               : UDINT;
nCurrentSearchAddress  : UDINT;
arrAddressedDevices    : 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.

nCurrentSearchAddress: Current search address (SEARCH ADDRESS).

arrAddressedDevices: Once a short address is assigned to a ballast, the associated element is set in the array. The array index reflects the short address of the ballast.

VAR_IN_OUT

stCommandBuffer      : ST_DALIV2CommandBuffer;

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