FB_DALIV2AddressingIntRandomAddressing

FB_DALIV2AddressingIntRandomAddressing 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 initiates the block, and the bBusy output goes TRUE. Depending on the selected options (parameter nOptions) the group associations and scenarios are subsequently deleted. The terminal now addresses all ballasts independently. Once all ballasts have been addressed, the bBusy output switches back to FALSE. The nAddressedDevices output variable supplies information about how many ballasts have received a short address. Processing this function block can take several minutes, depending on how many ballasts are attached. Since the addressing is performed directly by the terminal, this method is somewhat faster than the FB_DALIV2AddressingRandomAddressing() function block. However, this function block does not supply any feedback during addressing. In addition to that, addressing cannot be terminated prematurely.

This function block can only be executed if the terminal has the firmware version 2A or newer.

VAR_INPUT

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

bStart: A rising edge at this input activates the block, thereby starting 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

VAR_OUTPUT

bBusy              : BOOL;
bError             : BOOL;
nErrorId           : UDINT;
nAddressedDevices  : BYTE;

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.

nAddressedDevices: If addressing has been completed (bBusy is FALSE), then the number of addressed ballasts is shown at this output.

VAR_IN_OUT

stCommandBuffer      : ST_DALIV2CommandBuffer;

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