FB_DALI102Observer

FB_DALI102Observer 1:

The function block checks all DALI control gears on a DALI line for errors. Furthermore, it is checked whether there are unaddressed DALI control gears on the DALI line.

For checking the DALI line, the function blocks FB_DALI102QueryControlGearFailure, FB_DALI102QueryLampFailure and FB_DALI102QueryMissingShortAddress are called cyclically (see tCycle). Here, all DALI commands are executed as a broadcast. This allows all DALI control gears of a DALI line to be checked with one DALI command.

nOptions specifies which checks are executed at the DALI line. The verification of the DALI line can also be started immediately by a positive edge at the input bStartVerification.

If the error state of a DALI control gear changes, the current state is read out from all DALI control gears. The output aStates contains the returned status information of the entire DALI line. Each element of aStates contains the two error information of the respective DALI control gear. The meaning of the bits is defined as follows:

Bit

Meaning

0

Status of the DALI control gear (see controlGearFailure)

1

Lamp failure (see lampFailure)

Some error states can only be detected when the lamp is switched on.

If an unaddressed DALI control gear is detected, it is automatically addressed with the first free short address (starting at 0). Addressing is not executed if several DALI control gears without short address are detected.

If several defective DALI control gears are to be replaced or additional DALI control gears are to be added, this can only be done device by device. Add an unaddressed DALI control gear and wait until it is addressed (by using the option Tc3_DALI.GVL.cOpticalFeedback the newly addressed DALI control gear goes to the brightness maxLevel). Only then add the next unaddressed DALI control gear.

FB_DALI102Observer 2:

The function block should only be used with the DALI-2 certified KL6821/EL6821.

FB_DALI102Observer 3: Inputs

VAR_INPUT
  bEnable             : BOOL := FALSE;
  bStartVerification  : BOOL;
  tCycle              : TIME := T#1M;
  nOptions            : DWORD := GVL.cOpticalFeedback OR GVL.cCheckControlGearFailure OR GVL.cCheckLampFailure OR GVL.cCheckUnaddressedControlGears;
END_VAR

Name

Type

Description

bEnable

BOOL

If the input is TRUE, the verification of the DALI control gears is enabled. If the input is FALSE, the verification of the DALI control gears is disabled.

bStartVerification

BOOL

A positive edge at this input starts immediately the verification of the DALI line. This is independent of whether the verification has been enabled or disabled (bEnable).

tCycle

TIME

Cycle time in which the DALI control gears are verified. Set the cycle time such that as few DALI commands as possible are sent. If the time is set to 0 s, the verification of the DALI line is not executed cyclically.

nOptions

DWORD

Options for checking the DALI line (see table below). The individual constants must be linked with OR operators.

Options for verification

Constant

Description

Tc3_DALI.GVL.cCheckControlGearFailure

It is checked whether there are one or more defective DALI control gears on the DALI line.

Tc3_DALI.GVL.cCheckLampFailure

It is checked whether there are one or more DALI control gears with a defective lamp on the DALI line.

Tc3_DALI.GVL.cCheckUnaddressedControlGears

It is checked whether there are one or more new DALI control gears (without short address) on the DALI line.

Tc3_DALI.GVL.cOpticalFeedback

Prior to addressing, all control gears are set to minLevel. Newly addressed DALI control gears are assigned maxLevel brightness after assignment of the short address.

FB_DALI102Observer 4: Outputs

VAR_OUTPUT
  bError                  : BOOL;
  ipResultMessage         : I_TcMessage;
  bBusy                   : BOOL;
  aStates                 : ARRAY [0..63] OF BYTE;
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.

aStates

ARRAY OF BYTE

Array containing the read states of all DALI control gears (see table above).

FB_DALI102Observer 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.4024.29

Tc3_DALI from v3.11.0.0