FB_BA_LightAnalog

This template is used to control an analog light actuator.
The core element is the analog output function block FB_BA_AO_Raw, which provides the light value in BACnet and also converts the light value from 0 to 100 % to 0 to 32767. The allocated variable nLgtVal enables a direct link to a dimmer terminal (KL2751, KL2761).
The function block ignores the color temperature when controlling the light actuator.
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_LightAnalog EXTENDS FB_BA_View
VAR_INPUT
bEn : BOOL;
stLightingCmd : ST_BA_Lighting;
END_VAR
VAR_OUTPUT
fActualLightValue : REAL;
eActualLightPrio : BYTE;
stFeedback : ST_BA_LightActuatorFeedback;
END_VAR
VAR_INPUT CONSTANT
ActualLightValue : FB_BA_AO_Raw;
END_VAR
VAR
nLgtVal AT %Q* : INT;
END_VAR
Inputs
Name | Type | Description |
---|---|---|
bEn | BOOL | Enabling the function block. |
stLightingCmd | Resulting telegram from the higher-level zone (room). |
Outputs
Name | Type | Description |
---|---|---|
fActualLightValue | REAL | Current light value in percent. |
eActualLightPrio | BYTE | Current priority of the command telegram stLightingCmd. |
stFeedback | 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. |
Inputs CONSTANT
Name | Type | Description |
---|---|---|
ActualLightValue | Function block for converting the percentage light value to the value range 0..32767 and for simultaneous display in BACnet. |
Requirements
Development environment | Necessary function |
---|---|
TwinCAT from v3.1.4024.35 | TF8040 | TwinCAT Building Automation from V5.0.0.0 |