FB_BA_LightDALI_TC

This template is used to control a DALI light actuator, a DALI group or DALI devices with a broadcast, whereby color temperature control is supported.
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 or the color temperature is changed in the command telegram, the output values byActlLgtVal, fActlLgtVal and fActlLgtT initially correspond to these control values. Internally, however, in the function block FB_BA_LightActrDALI_TC, the actual light value and the actual color temperature are queried cyclically. This ensures that the true state of the DALI luminaire is displayed without placing an unnecessary load on the DALI bus.
The current light value is made available in BACnet via an analog object FB_BA_AV_Op, while the current color temperature is only displayed as a template output.
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.
![]() | The initialization of the template takes place within the method FB_Init. |
Block diagram

Syntax
FUNCTION_BLOCK FB_BA_LightDALI_TC EXTENDS FB_BA_View
VAR_INPUT
bEn : BOOL;
stLightingCmd : ST_BA_Lighting;
bInitialize : BOOL;
END_VAR
VAR_OUTPUT
bInitializing : BOOL;
bErr : BOOL;
fActualLightValue : REAL;
fActualLightTemperature : 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
Inputs
Name | Type | Description |
---|---|---|
bEn | BOOL | Enabling the function block: A TRUE signal activates the function. |
stLightingCmd | 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). |
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. |
fActualLightTemperature | REAL | Current color temperature in Kelvin. |
eActualLightPrio | Current priority of the command telegram stLightingCmd. | |
stFeedback | Feedback telegram for linking to the controlling room (zone) user function. In this way, information about the state of the light actuator is fed back into the application function. |
Inputs CONSTANT PERSISTENT
Name | Type | Description |
---|---|---|
eAdrType | 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 | Interface pointer to the DALI communication block. |
Inputs CONSTANT
Name | Type | Description |
---|---|---|
LightActr | Light control block without color temperature control. | |
ActualLightValue | 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 |