FB_DALIV2AddressingRandomAddressing
The function block FB_DALIV2AddressingRandomAddressing 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 function block now addresses all control gears independently. The output variable arrAddressedDevices provides information about which control gears have already been assigned a short address. Once all control gears have been addressed, the bBusy output switches back to FALSE. Addressing can be aborted through a positive edge at input bCancel. Processing this function block can take several minutes, depending on how many control gears are attached.
Inputs
VAR_INPUT
bStart : BOOL;
bCancel : 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. |
bCancel | BOOL | A positive edge at this input deactivates the function block, thereby interrupting 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. |
DALIV2_OPTION_WITHOUT_RANDOMISE | The RANDOMISE command is not called before the addressing sequence. This means that all control gears retain their existing random address (RANDOM ADDRESS). Only use this option when necessary. |
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_KL6811Communication (KL6811) or FB_KL6821Communication (KL6821). |
Outputs
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
nErrorId : UDINT;
nCurrentSearchAddress : UDINT;
arrAddressedDevices : ARRAY [0..63] OF BOOL;
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). |
nCurrentSearchAddress | UDINT | Current search address (see SEARCH ADDRESS) |
arrAddressedDevices | ARRAY OF BOOL | Once a short address is assigned to a control gear, the associated element is set in the structure. The structure index reflects the short address of the control gear. |
Requirements
Development Environment | PLC library to include |
---|---|
TwinCAT from v3.1.4020.14 | Tc2_DALI from v3.4.3.0 |