FB_DALIV2AddressingPhysicalSelection

FB_DALIV2AddressingPhysicalSelection 1:

The function block FB_DALIV2AddressingPhysicalSelection addresses the control gears through 'physical selection' based on the addressing technique. This means that the individual control gears are selected (and therefore addressed) by removing the lamps. Short addresses are assigned (ascending) in the same order in which the lamps are removed.

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 eCurrentAddressingState output specifies the next required user operation. It determines whether for the next control gear the lamp should be removed or reinserted. The arrAddressedDevices output variable provides information about which control gears have already been assigned a short address. Once all control gears have been addressed, the addressing procedure is completed through a positive edge at input bStop, and the output bBusy switches back to FALSE.

FB_DALIV2AddressingPhysicalSelection 2: Inputs

VAR_INPUT
  bStart                 : BOOL;
  bStop                  : 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.

bStop

BOOL

A positive edge at this input disables the function block, thereby stopping 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.

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.

FB_DALIV2AddressingPhysicalSelection 3: 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).

FB_DALIV2AddressingPhysicalSelection 4: Outputs

VAR_OUTPUT
  bBusy                   : BOOL;
  bError                  : BOOL;
  nErrorId                : UDINT;
  arrAddressedDevices     : ARRAY [0..63] OF BOOL;
  eCurrentAddressingState : E_DALIV2CurrentAddressingState;
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).

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.

eCurrentAddressingState

E_DALIV2CurrentAddressingState

The output variable indicates the current step.

Element

Description

eDALIV2AddrStateIdle

No addressing takes place.

eDALIV2AddrStateRemoveLamp

The function block waits for a lamp to be removed at a control gear.

eDALIV2AddrStateReinsertLamp

The function block has detected the control gear on which the lamp was removed (the control gear is selected) and now waits for it to be inserted again.

eDALIV2AddrStateAddressingLamp

The selected control gear is addressed.

Requirements

Development Environment

PLC library to include

TwinCAT from v3.1.4020.14

Tc2_DALI from v3.4.3.0