FB_DALIV2SetShortAddress

FB_DALIV2SetShortAddress 1:

The function block FB_DALIV2SetShortAddress is used to assign a (new) short address to one or more control gears. Valid short addresses lie in the range between 0 and 63. If 255 is specified as the short address, the short address in the control gear is deleted.

If you want to give a short address to a device that does not yet have one, you must transmit the command as a broadcast (eAddrType = eDALIV2AddrTypeBroadcast). This gives all control gears connected to the DALI terminal the short address nNewShortAddress. This includes the control gears that previously did not have a short address.

FB_DALIV2SetShortAddress 2: Inputs

VAR_INPUT
  bStart            : BOOL;
  nAddr             : BYTE;
  eAddrType         : E_DALIV2AddrType := eDALIV2AddrTypeShort;
  nNewShortAddress  : BYTE;
END_VAR

Name

Type

Description

bStart

BOOL

The function block is activated by a positive edge at this input.

nAddr

BYTE

The address of a device or of a group

eAddrType

E_DALIV2AddrType

Short address, group address or broadcast

nNewShortAddress

BYTE

New short address (0-63) or mask (255)

FB_DALIV2SetShortAddress 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_DALIV2SetShortAddress 4: Outputs

VAR_OUTPUT
  bBusy    : BOOL;
  bError   : BOOL;
  nErrorId : UDINT;
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).

Requirements

Development Environment

PLC library to include

TwinCAT from v3.1.4020.14

Tc2_DALI from v3.4.3.0