FB_DALIV2AddressingIntRandomAddressing

FB_DALIV2AddressingIntRandomAddressing 1:

The function block FB_DALIV2AddressingIntRandomAddressing addresses the control gears at random. The user has no influence over which short address is assigned to which control gear. Short addresses are allocated in ascending order.

Applying a positive edge to the bStart input starts the function block, and the output bBusy goes TRUE. Depending on the selected options (parameter nOptions) the group membership and scenes are subsequently deleted. The terminal now addresses all control gears independently. Once all control gears have been addressed, the bBusy output switches back to FALSE. The nAddressedDevices output variable supplies information about how many control gears have received a short address. Processing this function block can take several minutes, depending on how many control gears are attached. Since the addressing is performed directly by the terminal, this method is somewhat faster than the function block FB_DALIV2AddressingRandomAddressing. However, this function block does not supply any feedback during addressing. In addition to that, addressing cannot be terminated prematurely.

FB_DALIV2AddressingIntRandomAddressing 2:

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

FB_DALIV2AddressingIntRandomAddressing 3: Inputs

VAR_INPUT
  bStart                 : BOOL;
  nStartWithShortAddress : BYTE := 0;
  nOptions               : DWORD := DALIV2_OPTION_OPTICAL_FEEDBACK;
END_VAR

Name

Type

Description

bStart

BOOL

A positive edge at this input activates the function block, thereby starting the addressing sequence.

nStartWithShortAddress

BYTE

Short address allocated to the first control gear (0 ... 63).

nOptions

DWORD

Options for addressing the control gears (see table). The individual constants must be linked with OR operators.

Constant

Description

DALIV2_OPTION_COMPLETE_NEW_INSTALLATION

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

DALIV2_OPTION_DELETE_ALL_GROUP_ASSIGNMENTS

Before addressing, the group assignments (see variables GROUP 0-7 and GROUP 8-15) are deleted for all control gears, including those that may not be addressed.

DALIV2_OPTION_DELETE_ALL_SCENE_ASSIGNMENTS

Before addressing, the scenes (see variables SCENE 0 to SCENE 15) are deleted for all control gears, including those that may not be addressed.

DALIV2_OPTION_OPTICAL_FEEDBACK

Before addressing, all control gears are set to MIN LEVEL. Newly addressed control gears are assigned MAX LEVEL brightness after assignment of the short address.

FB_DALIV2AddressingIntRandomAddressing 4: Inputs/outputs

VAR_IN_OUT
  stCommandBuffer   : ST_DALIV2CommandBuffer;
END_VAR

Name

Type

Description

stCommandBuffer

ST_DALIV2CommandBuffer

Reference to the internal structure for communication with FB_KL6821Communication (KL6821).

FB_DALIV2AddressingIntRandomAddressing 5: Outputs

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

Name

Type

Description

bBusy

BOOL

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

bError

BOOL

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

UDINT

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

BYTE

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

Requirements

Development Environment

PLC library to include

TwinCAT from v3.1.4020.14

Tc2_DALI from v3.4.3.0