FB_BA_LightDALI_Base

FB_BA_LightDALI_Base 1:

This template is used to control a DALI light actuator, a DALI group or DALI devices with a broadcast, whereby only the light brightness value is changed.

The core is the light control block LightActr. This establishes the connection to a DALI luminaire (or group) and converts changes in the light telegram stLightingCmd into DALI control signals. In addition, input bInitialize can be used to initialize the DALI luminaire (or group) with the parameters set on the function block (minimum value, maximum value, etc.).

It should be noted that if the light control value is changed in the command telegram, the output values byActlLgtVal and fActlLgtVal initially correspond to this control value. Internally, however, in the function block FB_BA_LightActrDALI_Base, the actual light value is queried cyclically. This ensures that the true state of the DALI luminaire is displayed without placing an unnecessary load on the DALI bus.

The function block ignores the color temperature when controlling the light actuator.

The current light value is made available in BACnet via an analog object FB_BA_AV_Op.

The template has a feedback structure stFeedback.

If the programmed light actuator is an individual actuator or the reference actuator of a group, this feedback telegram must be linked to the controlling room (zone) user function in order to obtain information about the state of the actuator.

FB_BA_LightDALI_Base 2:

The initialization of the template takes place within the method FB_Init.

Block diagram

FB_BA_LightDALI_Base 3:

Syntax

FUNCTION_BLOCK FB_BA_LightDALI_Base EXTENDS FB_BA_View
VAR_INPUT
  bEn                    : BOOL;
  stLightingCmd          : ST_BA_Lighting;
  bInitialize            : BOOL;
END_VAR
VAR_OUTPUT
  bInitializing          : BOOL;
  bErr                   : BOOL;
  fActualLightValue      : REAL;
  eActualLightPrio       : BYTE;
  stFeedback             : ST_BA_LightActuatorFeedback;
END_VAR
VAR_INPUT CONSTANT PERSISTENT
  eAdrType               : Tc3_DALI.E_DALIAddressType := Tc3_DALI.E_DALIAddressType.Short;
  nAdr                   : BYTE;
  nAdrRefDev             : BYTE;
  ipDALICommunication    : Tc3_DALI.I_DALICommunication;
END_VAR
VAR_INPUT CONSTANT
  LightActr              : FB_BA_LightActrDALI_Base;
  ActualLightValue       : FB_BA_AV_Op;
END_VAR

FB_BA_LightDALI_Base 4: Inputs

Name

Type

Description

bEn

BOOL

Enabling the function block: A TRUE signal activates the function.

stLightingCmd

ST_BA_Lighting

Command telegram from the higher-level zone (room).

bInitialize

BOOL

A positive edge at this input starts the DALI initialization routine, which transfers the set parameters to the control gears (see FB_BA_LightActrDALI_Base).

FB_BA_LightDALI_Base 5: Outputs

Name

Type

Description

bInitializing

BOOL

The light actuator or the actuators are in the DALI initialization phase, i.e. the entered parameters are transferred to the controlled control gears.

bErr

BOOL

Error output. A plain text is output in TwinCAT in the error list in the output window.

fActualLightValue

REAL

Current light value in percent.

eActualLightPrio

E_BA_LightingPrio

Current priority of the command telegram stLightingCmd.

stFeedback

ST_BA_LightActuatorFeedback

Feedback telegram for linking to the controlling room (zone) application function. In this way, information about the state of the light actuator is fed back into the application function.

FB_BA_LightDALI_Base 6: Inputs CONSTANT PERSISTENT

Name

Type

Description

eAdrType

Tc3_DALI.E_DALIAddressType

Selection of the control type: individual, group or broadcast control, pre-set to individual control.

nAdr

BYTE

DALI address of the actuator or group.

nAdrRefDev

BYTE

DALI address of a reference device if group or broadcast control is selected. This reference device then represents all other controlled devices.

ipDALICommunication

Tc3_DALI.I_DALICommunication

Interface pointer to the DALI communication block.

FB_BA_LightDALI_Base 7: Inputs CONSTANT

Name

Type

Description

LightActr

FB_BA_LightActrDALI_Base

Light control block without color temperature control.

ActualLightValue

FB_BA_AV_Op

Function block for displaying the percentage light value in BACnet.

Requirements

Development environment

Necessary function

TwinCAT from v3.1.4024.35

TF8040 | TwinCAT Building Automation from V5.0.0.0