FB_DALIVirtualControlGear

FB_DALIVirtualControlGear 1:

The function block represents a DALI control gear on a virtual DALI line.

For each virtual DALI control gear an instance of FB_DALIVirtualControlGear must be created. During the declaration the interface pointer of FB_DALIVirtualCommunication is passed, whereby the virtual DALI control gear is assigned to the virtual DALI line.

The individual variables for the virtual DALI control gear are set via Properties. The same function blocks as for real DALI control gears are used for access from the application program, e.g. FB_DALI102GoToScene, FB_DALI102SetMinLevel or FB_DALI102QueryContentDTR0.

Currently FB_DALIVirtualControlGear supports most DALI commands to Part 102.

The DALI PLC Simulation Tool is a TwinCAT 3 sample application that can be used to visualize virtual DALI control gears. The individual parameters of the virtual DALI control gears can be set via corresponding dialogs.

FB_DALIVirtualControlGear 2: Outputs

VAR_OUTPUT
  bError                     : BOOL;
  ipResultMessage            : I_TcMessage;
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.

FB_DALIVirtualControlGear 3: Properties

Via Properties the variables of the virtual DALI control gear can be set or also queried.

Name

Type

Access

Initial value

Description

aSceneLevels

REFERENCE TO ARRAY [0..15] OF BYTE

Get, Set

[16(255)]

See scene0...scene15.

bControlGearFailure

BOOL

Get, Set

FALSE

See controlGearFailure.

bLampFailure

BOOL

Get, Set

FALSE

See lampFailure.

eExtendedFadeTimeBase

E_DALIExtendedFadeTimeBase

Get, Set

E_DALIExtendedFadeTimeBase.Base01

See extendedFadeTimeBase.

eExtendedFadeTimeMultiplier

E_DALIExtendedFadeTimeMultiplier

Get, Set

E_DALIExtendedFadeTimeMultiplier.Disabled

See extendedFadeTimeMultiplier.

eFadeRate

E_DALIFadeRate

Get, Set

E_DALIFadeRate.N045StepsPerSec

See fadeRate.

eFadeTime

E_DALIFadeTime

Get, Set

E_DALIFadeTime.Disabled

See fadeTime.

nActualLevel

BYTE

Get, Set

254

See actualLevel.

nDTR0

BYTE

Get, Set

0

See DTR0...DTR2.

nDTR1

BYTE

Get, Set

0

See DTR0...DTR2.

nDTR2

BYTE

Get, Set

0

See DTR0...DTR2.

nGroups

WORD

Get, Set

16#0000

See gearGroups.

nMaxLevel

BYTE

Get, Set

254

See minLevel / maxLevel.

nMinLevel

BYTE

Get, Set

85

See minLevel / maxLevel.

nPhysicalMinimum

BYTE

Get, Set

85

See physicalMinLevel.

nPowerOnLevel

BYTE

Get, Set

254

See powerOnLevel. The output value is set to nPowerOnLevel as soon as the function block is initialized (e.g. restart of the PLC program).

nShortAddress

BYTE

Get, Set

255

See shortAddress.

nStatus

BYTE

Get, Set

0

Status of the DALI control gear. See also FB_DALI102QueryStatus.

nSystemFailureLevel

BYTE

Get, Set

254

See systemFailureLevel.

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.29

Tc3_DALI from v3.11.0.0