FB_BA_CnstLgtCtrl

Constant light control for a room

FB_BA_CnstLgtCtrl 1:

This function block requires light value feedback at input lrActlLgtLvl, in order to be able to change the light level (toggle command). Without this feedback, which either comes from a single device or as an average from a group, the switch function block does not know the logical state of the light and is unable to toggle to the other state when the keyboard shortcut bSwi is pressed. See also FB_BA_LgtSwi.

FB_BA_CnstLgtCtrl 2:

Functional description

This function block is a can be combined switch/dimmer with additional constant light control mode. Internally, the constant light control uses a PI controller.

Various modes (eOnMod) are defined for central switching on at bOn, which can be selected via this enumerator input:

All other commands see below.

The function block sends its commands via the command telegram stLgtCmd.

Inputs/outputs

VAR_INPUT

bEnCtrl        : BOOL;
eSttUpCtrlMod  : E_BA_CtrlSttupMod;
lrSttUpCtrlVal : LREAL;
lrSp           : LREAL;
lrContrVar     : LREAL;
lrKp           : LREAL;
udiTn          : UDINT;
lrNz           : LREAL;
bSwi           : BOOL;
bSwiUp         : BOOL;
bSwiDwn        : BOOL;
udiSwiOvrTi    : UDINT;
bUp            : BOOL;
bDwn           : BOOL;
bOn            : BOOL;
bOff           : BOOL;
eOnMod         : E_BA_LgtOnMode;
lrOnValue      : LREAL;
bClMinVal      : BOOL;
bClMaxVal      : BOOL;
bSetValDct     : BOOL;
lrSetValDct    : LREAL;
lrActlLgtLvl   : LREAL;

bEnCtrl: a positive edge on this input switches the control on. If the switching inputs bSwi...bSetValDct are actuated, the control is disabled again, irrespective of whether a TRUE signal is present at input bEnCtrl.

eSttUpCtrlMod/lrSttUpCtrlVal: specifies with which value the controller should start up: see E_BA_CtrlSttupMod.

lrSp: setpoint input [lx]

lrContrVar: actual value input [lx]

lrKp: gain factor of the internal PI controller

udiTn: integral action time (integration time) of the internal PI controller [ms]

lrNz: neutral zone: if the absolute value of the control deviation is less than lrNz/2, the controller stops its internal control value calculation, but remains active.

bSwi: switch input on/off, dimming up/down: a short signal (< udiSwiOvrTi) turns the light off or on depending on the state. If the switch is kept pressed, the light is alternately dimmed up or down. Dimming up ends when the maximum value is reached, and dimming down ends when the minimum value is reached. The dimming direction is not reversed automatically. If the light is switched off, it is first set to the minimum value, before it is dimmed up.

bSwiUp: switch input On/Off, dimming up: a short signal (< udiSwiOvrTi) turns the light off or on depending on the state. If the switch is kept pressed, the light is dimmed up. Dimming up ends when the maximum value is reached. If the light is switched off, it is first set to the minimum value, before it is dimmed up.

bSwiDwn: switch input On/Off, dimming down: a short signal (< udiSwiOvrTi) turns the light off or on depending on the state. If the switch is kept pressed, the light is dimmed down. Dimming down stops when the minimum value is reached. If the light is switched off, it is first set to the maximum value, before it is dimmed down.

udiSwiOvrTi: switching time [ms] between short/long switch pressing detection, and therefore between switching and dimming.

bUp: dimming up. This input has no switching function and is not affected by the switching time udiSwiOvrTi. The function has no effect when the light is switched off.

bDwn: dimming down. This input has no switching function and is not affected by the switching time udiSwiOvrTi. The function has no effect when the light is switched off.

bOn: central switch-on. The switch-on value depends on the choice of eOnMod, see below.

bOff: central switch-off.

eOnMod: selection of the switch-on value (E_BA_LgtOnMode).

lrOnVal: [0...100%] switch-on value, if a central switch-on command comes via bOn and mode eBA_ClOnVal is selected at eOnMod.

bClMinVal: the light actuator function block is instructed to switch to the minimum value.

bClMaxVal: the light actuator function block is instructed to switch to the maximum value.

bSetValDct/lrSetValDct: switches the light actuator function block to the value lrSetValDct [0..100%]. Note: The value lrLgtOffset is applied to this value at the light actuator.

lrActlLgtLvl: [0...100%] this input is used for toggle evaluation. For a group of lamps, it is recommended to create either the average of all actuators or the light value of the group master.

VAR_OUTPUT

bCtrlActv : BOOL;
lrCtrlVal : LREAL;
stLgtCmd  : ST_BA_LgtCmd;

bCtrlActv: constant light regulation is active

lrCtrlVal: current value that is output in command telegram stLgtCmd (of type ST_BA_LgtCmd).

lrSyncVal: [0..100%]  for control: current start value selected through mode eSttUpCtrlMod (see inputs).

stLgtCmd: command telegram of type ST_BA_LgtCmd.

Requirements

Development environment

Target system

required library

required supplement

TwinCAT 2.11 R3/x64

PC/CX

TcBA library from V1.0.0

TS8040 | TwinCAT Building Automation from V1.0.0