FB_DALIV2xAddressingIntRandomAddressing

FB_DALIV2xAddressingIntRandomAddressing 1:

This function block addresses the control units (sensors) at random. The user has no influence on which control unit is assigned which short address. Short addresses are allocated in ascending order.

Applying a positive edge to the bStart input starts the function block, and the bBusy output goes TRUE. The terminal now addresses all control units independently. If all control units are addressed, the bBusy output goes back to FALSE. The output variable nAddressedDevices provides information on how many control units were assigned a short address. Depending on the number of connected control units, processing of this function block can take several minutes.

VAR_INPUT

bStart                  : BOOL;
nStartWithShortAddress  : BYTE := 0;
nOptions                : DWORD := DALIV2_OPTION_OPTICAL_FEEDBACK;
eDataFrameType          : E_DALIV2DataFrameType := eDALIV2DataFrameType24Bit;

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

nStartWithShortAddress: Short address assigned to the first control unit (0... 63).

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

eDataFrameType: Output format of the DALI command (eDALIV2DataFrameType24Bit or eDALIV2DataFrameTypeOsram).

Constant

Description

DALIV2_OPTION_COMPLETE_NEW_INSTALLATION

All control units are redirected, even those that already have a short address.

DALIV2_OPTION_OPTICAL_FEEDBACK

Before addressing, all devices are set to MIN LEVEL, MAX LEVEL brightness after allocation of the short address.

VAR_OUTPUT

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

bBusy: When the function 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 as soon as 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 a command at the inputs.

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

nAddressedDevices: When addressing is completed (bBusy is FALSE), the number of addressed control units is displayed at this output.

VAR_IN_OUT

stCommandBuffer   : ST_DALIV2CommandBuffer;

stCommandBuffer: Reference to the structure for communication with the function block FB_KL6821Communication() (KL6821).

Requirements

Development environment

Target system

Required libraries

TwinCAT 2.11 R3/x64 from build 2260

PC/CX, BX or BC

TcDALIV2 library from V2.12.0