FB_DALIV2AddressingPhysicalSelection
This function block addresses the ballasts through 'physical selection' based on the addressing technique. This means that the individual ballasts are selected (and therefore addressed) by removing the lamps. Short addresses are allocated (ascending) in the same order in which the lamps are removed.
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 eCurrentAddressingState output specifies the next required user operation. It determines whether for the next ballast the lamp should be removed or reinserted. The arrAddressedDevices output variable provides information about which ballasts have already been allocated a short address. Once all ballasts have been addressed, the addressing procedure is completed through a rising edge at input bStop, and the bBusy output switches back to FALSE.
VAR_INPUT
bStart : BOOL;
bStop : BOOL;
nStartWithShortAddress : BYTE;
nOptions : DWORD := DALIV2_OPTION_OPTICAL_FEEDBACK;
bStart: A rising edge at this input activates the block, thereby starting the addressing sequence.
bStop: A rising edge at this input deactivates the block, thereby stopping 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.
Constants | 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_WITHOUT_RANDOMISE | 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;
arrAddressedDevices : ARRAY[0..63] OF BOOL;
eCurrentAddressingState : E_DALIV2CurrentAddressingState;
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.
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.
eCurrentAddressingState: The output variable indicates the current step (see table).
Element | Description |
---|---|
eDALIV2AddrStateIdle | No addressing takes place. |
eDALIV2AddrStateRemoveLamp | The block waits for a lamp to be removed at a ballast. |
eDALIV2AddrStateReinsertLamp | The block has detected the ballast on which the lamp was removed (the ballast is selected) and now waits for it to be inserted again. |
eDALIV2AddrStateAddressingLamp | The selected ballast is addressed. |
VAR_IN_OUT
stCommandBuffer : ST_DALIV2CommandBuffer;
stCommandBuffer: A reference to the structure for communication with the FB_DALIV2Communication() (KL6811) or FB_KL6821Communication() (KL6821) block.