FB_BA_DALILgtActr

Function block for controlling a DALI light actuator

FB_BA_DALILgtActr 1:

Functional description

The function block receives its commands via the command telegram stLgtCmd.
As an IN/OUT variable and light control function block for the DALI subsystem, it contains a reference to the command memory structure stDALICmdBuf.

Inputs/outputs

VAR_INPUT

byShrtAdr        : BYTE;
byGrpAdr         : BYTE;
eMod             : BOOL;
lrSttupCtrlVal   : LREAL;
lrMinCtrlVal     : LREAL;
lrMaxCtrlVal     : LREAL;
lrLgtOffset      : LREAL;
uiDimTi          : UINT;
uiBlinkTi        : UINT;
uiOffDly         : UINT;
uiPollActLgtLvl  : UINT;
bReinit          : BOOL;
stLgtCmd         : ST_BA_LgtCmd;

byShrtAdr : short address of the DALI control gear to be addressed. This address must be in the valid range of 0..63, since the function block needs an existing control gear to query the state. If an invalid address is entered, the function block is not executed, and a corresponding error code is issued. The short address relates to the DALI commands resulting from the inputs at this function block:

byGrpAdr: group address. Only taken into account if the control gear is operated as a master by this function block: eMod=eBA_DALIModGrpMst or eMod=eBA_DALIModGrpSgl.

FB_BA_DALILgtActr 2:

Even if this function block should control a group as a master, the short address of the master must always be entered at byShrtAdr, since data is read from the corresponding control gear as a representative of the entire group.

eMod: selection of the individual/group or master/slave behavior of the function block; see E_BA_DALIMod.

lrSttupCtrlVal: light value after restart

lrMinCtrlVal: minimum light output value. [0..100%]. A change at the function block input causes a re-parameterization (short address) in the control gear. There, the lower limit is set to the physical minimum value, the upper limit to the maximum value.

lrMaxCtrlVal: maximum light output value. [0..100%]. A change at the function block input causes a re-parameterization (short address) in the control gear. There, the lower limit is set to the physical minimum value.

lrLgtOffset: option to increase or reduce the brightness value. This can be useful in a lamp group circuit for lamps that are situated near daylight and have to be less bright than the lamps in darker areas of the room. However, the light value cannot be controlled by this parameter via lrMaxCtrlVal or at lrMinCtrlVal.
This offset only affects commands that reach the function block via the command structure as bSetCtrlValDct.

udiDimTi: dimming ramp [s]: time in which dimming from 0 to 100% takes place. This is converted to a DALI FadeRate within the function block and stored in the control gear.

uiBlinkTi / uiOffDly: these two times [ms] can be used to implement a switch-off warning, e.g. for staircase lighting. These two intervals additionally take effect at the time when the lamp usually switches off: the light is switched off for the time uiBlinkTi [s] and switched on again for the time uiOffDly [s].

uiPollActLgtLvl: cycle time [s] required to read the current actual value (ACTUAL DIM LEVEL) in the background. So that the dimming of the lamps is not disturbed, reading always has the lowest priority. If the value is set to 0, reading is prohibited. In addition to the current light value, the status byte of the control gear is read and written to output byDALIDevSta.

bReInit: edge-triggered input: restarts the initialization of the function block.

stLgtCmd: command telegram of type ST_BA_LgtCmd.

VAR_OUTPUT

lrActlLgtLvl     : LREAL;
byActlLgtLvl     : BYTE;
bLgt             : BOOL;
lrActlMinCtrlVal : LREAL;
bMinCtrlValRchd  : BOOL;
lrActlMaxCtrlVal : LREAL;
bMaxCtrlValRchd  : BOOL;
lrRstVal         : LREAL;
byActlFadeRate   : BYTE;
byPhysMinVal     : BYTE;
byActlMinCtrlVal : BYTE;
byActlMaxCtrlVal : BYTE;
bInitDevice      : BOOL;
bBlinkSeqStarted : BOOL;
bActionBusy      : BOOL;
bErr             : BOOL;
udiErrId         : UDINT;
udiErrArg        : UDINT;
byDALIDevSta     : BYTE;

lrActlLgtLvl: current light output value [0..100%]

byActlLgtLvl: current light output value [0..254]

bLgt: light is switched on or off

lrActlMinCtrlVal: current valid minimum value. The output of this value is only verified in the initialization phase of the function block (and therefore the respective control gear) through a QueryMinLevel query. Subsequently, the value is output at the output that is programmed in the control gear via the function block input or the command structure. It can be limited to the physical minimum or maximum value.

bMinCtrlValRchd: the actuator has reached its minimum value.

lrActlMaxCtrlVal: current valid maximum value. The output of this value is only verified in the initialization phase of the function block (and therefore the respective control gear) through a QueryMinLevel query. Subsequently, the value is output at the output that is programmed in the control gear via the function block input or the command structure. It can be limited to the physical minimum or to 100%.

bMaxCtrlValRchd: the actuator has reached its maximum value.

lrRstVal:this variable is used to store the light value before switching off. The command bClRstVal in the command structure can be used to restore this value. Application example: the light is switched back on again in a conference room after a presentation.

byActlFadeRate: currently applicable DALI FadeRate, which results from the dimming time (input uiDimTi).

byPhysMinVal: physical minimum value [1..254] read during the initialization phase of the function block.

byActlMinCtrlVal: see lrActlMinCtrlVal. Converted from [0..100%] to the range [0..254].

byActlMaxCtrlVal: see lrActlMaxCtrlVal. Converted from [0..100%] to the range [0..254].

bInitDevice: light function block in the initialization phase: the following actions are executed:

bBlinkSeqStarted: the flash sequence has been started.

bActionBusy: a DALI command is executed.

bErr: light function block in error state

udiErrId / udiErrArg: error number and argument for determining the cause; see error codes.

byDALIDevSta: status byte of the DALI control gear. It is read in the background, together with the automatic query of the light value; see input uiPollActLgtLvl.

VAR_IN_OUT

stDALICmdBuf : ST_DALIV2CommandBuffer;

stDALICmdBuf: reference to the command memory structure stDALICmdBuf

Requirements

Development environment

Target system

required library

required supplement

TwinCAT 2.11 R3/x64

PC/CX

TcBASubsystems library from V1.0.0

TS8040 | TwinCAT Building Automation from V1.0.0