FB_DALI102ChangeAddresses

FB_DALI102ChangeAddresses 1:

This function block can be used to change the short addresses of several DALI control gears.

A list of the DALI control gears for which the short address is to be changed is transferred in the array aChangeAddressList of type ST_DALIChangeAddressList. The list has 64 entries from 0 to 63. Each entry contains a variable nOldAddress and nNewAddress with which the address assignment is parameterized. The end of the list is programmed with a 255 entry at nOldAddress, so that the whole list does not necessarily have to be filled in. If this entry is missing, however, then all entries are accepted. When the function block is started (positive edge on bStart), the list end is first determined on the basis of the described entry and afterwards the valid list range is examined for the following false entries:

The function block then uses the short addresses to determine the internal long addresses of the DALI devices and enters them in the nRandomAddress parameter of the list.

If an error occurs during queries or during reprogramming, this leads to an error entry for the respective device in the list element nErrors (see ST_DALIChangeAddressList).

The individual bits in the list element nErrors have the following meaning:

 Bit

 Error

 0

 Error during reading of the long address

 1

 -

 2

 -

 3

 -

 4

 -

 5

 Error during programming of the new short address

 6

 nOldAddress and nNewAddress have the same values

FB_DALI102ChangeAddresses 2: Inputs

VAR_INPUT
  bStart              : BOOL;
  nOptions            : DWORD := 0;
END_VAR

Name

Type

Description

bStart

BOOL

Execution of the DALI commands is triggered via a positive edge at this input.

nOptions

DWORD

Reserved for future extensions.

FB_DALI102ChangeAddresses 3: Inputs/outputs

VAR_IN_OUT
  aChangeAddressList    : ARRAY [0..63] OF ST_DALIChangeAddressList;
END_VAR

Name

Type

Description

aChangeAddressList

ARRAY OF ST_DALIChangeAddressList

List of short addresses to be changed.

FB_DALI102ChangeAddresses 4: Outputs

VAR_OUTPUT
  bError                  : BOOL;
  ipResultMessage         : I_TcMessage;
  bBusy                   : BOOL;
END_VAR

Name

Type

Description

bError

BOOL

This output is switched to TRUE if an error occurs during the execution. Further information about the error can be queried via the variable ipResultMessage. The output is set to FALSE again as soon as bBusy switches to TRUE.

ipResultMessage

I_TcMessage

Interface pointer (see error evaluation) that can be used to obtain detailed information about the processing of the function block (see runtime messages). The interface pointer is valid after bBusy has changed from TRUE to FALSE.

bBusy

BOOL

The output is set as soon as execution of the DALI commands has commenced. It remains active until all DALI commands have been processed.

FB_DALI102ChangeAddresses 5: Properties

Name

Type

Access

Initial value

Description

ipDALICommunication

I_DALICommunication

Get,Set

0

Interface Pointer to the communication block (see Transfer of the reference to the communication block).

Requirements

Development environment

required PLC library

TwinCAT from v3.1.4022.29

Tc3_DALI from v3.1.4.0