FB_DALIV2ConstantLightControlEco

FB_DALIV2ConstantLightControlEco 1:

The block FB_DALIV2ConstantLightControlEco() is used for constant light control with DALI ballasts.

The system tries to match a specified set value through cyclic dimming. The control dynamics are determined by a dead time (tDeadTime). The dead time defines the delay between the individual commands for changing the control value. The smaller the dead time, the faster the control. A freely definable hysteresis (nHysteresis) prevents continuous oscillation around the set value. If the actual value is within the hysteresis range around the set value, the lamps brightness remains unchanged. An option is available for specifying whether the lamps should be switched on and off automatically (see table below).

Parameter nMasterDevAddr

The DALI system provides facilities not just for controlling lamps individually, but also for addressing them as groups or through common commands. Because the individual devices can be members of a variety of groups, it can happen that, prior to the issue of a group or common control command, the individual lamps have different brightness levels. So that it is nevertheless possible to be clear whether the lamps now are to be switched on or off, a master device is assigned to each group, whose state is followed by the other devices. It is not necessary to specify a master device if the function block is to be used to control a single lamp, eAddrType = eAddrTypeShort. In this case, the nMasterDevAddr parameter has no significance.

VAR_INPUT

bEnable                    : BOOL := TRUE;
bOn                        : BOOL;
bOff                       : BOOL;
bToggle                    : BOOL;
nSetpointValue             : UINT := 500;
nActualValue               : UINT;
nHysteresis                : UINT := 50;
tDeadTime                  : TIME := t#10s;
nAddr                      : BYTE := 0;
eAddrType                  : E_DALIV2AddrType := eDALIV2AddrTypeShort;
nMasterDevAddr             : BYTE := 0;
tCycleActualLevelMasterDev : TIME := t#0s;
nOptions                   : DWORD := 0;

bEnable: Enables the block. If this input is FALSE, the inputs bOn, bOff and bToogle are disabled. No control values are output.

bOn: Switches the addressed devices to MAX_LEVEL and activates constant light control.

bOff: Switches the addressed devices off and disables constant light control.

bToggle: The lighting is switched on or off, depending on the state of the reference device.

nSetpointValue: This input is used for specifying the set value.

nActualValue: The actual value is applied at this input.

nHysteresis: Control hysteresis around the set value. If the actual value is within this range, the control values for the lamps remain unchanged.

tDeadTime: Dead time between the individual commands used for changing the control value for the DALI lamps.

nAddr: The address of a participating device or of a group.

eAddrType: Short address, group address or broadcast.

nMasterDevAddr: The address of the master device for group and common switching operations.

tCycleActualLevelMasterDev: Cycle time 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.

nOptions: Options (see table). The individual constants must be linked with OR operators.

Constants

Description

DALIV2_OPTION_SWITCH_ON_AND_OFF

The DALI commands ON_AND_STEP_UP and STEP_DOWN_AND_OFF are used for changing the control value. This causes the lamps to be switched off when MIN_LEVEL

STEP_UP and STEP_DOWN are used. In this cases the lamps remain switched on continuously.

DALIV2_OPTION_SWITCH_ON_WITH_MIN_LEVEL

If the light is switched on again by the constant light control, this option always uses the command MIN_LEVEL. If the option is not set, MAX_LEVEL is used. This option is available from V2.9.3 of the PLC library.

VAR_OUTPUT

nActualLevelMasterDev: BYTE;
nDeviation           : INT;
bControllerIsActive  : BOOL;
bBusy                : BOOL;
bError               : BOOL;
nErrorId             : UDINT;

nActualLevelMasterDev: The current output value of the master device (if eAddrType = eAddrTypeShort this is always the device being addressed at the time).

nDeviation: Current control deviation (set value/actual value).

bControllerIsActive: This output is set once the control is activated.

bBusy: When the block is activated the output is set, and it remains active until execution of the command has been completed.

bError: This output is switched to TRUE if an error occurs during the execution of a command. The command-specific error code is contained in nErrorId. Is reset to FALSE by the execution of an instruction at the inputs.

nErrorId: Contains the command-specific error code of the most recently executed command. Is reset to 0 by the execution of an instruction at the inputs. See Error codes.

VAR_IN_OUT

stCommandBuffer        : ST_DALIV2CommandBuffer;

stCommandBuffer: A reference to the structure for communication with the FB_DALIV2Communication() (KL6811) or FB_KL6821Communication() (KL6821) block.