FB_DALIV2Dimmer2SwitchEco

FB_DALIV2Dimmer2SwitchEco 1:

The FB_DALIDimmer2SwitchEco() block is a variant of FB_DALIV2Dimmer2Switch() that saves memory space. It does not include the special "Switch memory function off" function.

Operation by means of the bSwitchDimmUp and bSwitchDimmDown inputs

The light is switched on or off by a short signal at the bSwitchDimmUp or bSwitchDimmDown inputs. Dimmer mode will be activated if the signal remains for longer than tSwitchOverTime (typical recommended value: 200ms). The addressed devices are now dimmed. When the signal is once more removed, the output signal being generated at that time is retained. Another pulse at one of the inputs will set the output to 0.

Operation by means of the bOn and bOff inputs

The light is immediately switched on or off if a rising edge is applied to the bOn or bOff inputs. The output value is set to 0 when switching off.

The memory function

In contrast to FB_DALIV2Dimmer2Switch(), where the memory function can be switched on or off through the bMemoryModeOn input, the memory function is always active on this memory-saving version. This means that the most recently set value is adopted for the brightness when switching on. It is irrelevant, in this case, whether the light it has been switched on by means of the bOn input or the bSwitchDimm input.

Parameter tSwitchOverTime

If a duration of 0 is specified for the parameter tSwitchOverTime, the bSwitchDimmUp and bSwitchDimmDown inputs can only be used to dim the light. Switching on and off is only possible with the bOn and bOff inputs.

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

bSwitchDimmUp               : BOOL;
bSwitchDimmDown             : BOOL;
bOn                         : BOOL;
bOff                        : BOOL;
bSetDimmValue               : BOOL;
nDimmValue                  : BYTE;
tSwitchOverTime             : TIME := t#400ms;
nAddr                       : BYTE := 0;
eAddrType                   : E_DALIV2AddrType := eDALIV2AddrTypeShort;
nMasterDevAddr              : BYTE := 0;
tCycleActualLevelMasterDev  : TIME := t#0s;

bSwitchDimmUp: Switches or dims the addressed devices up.

bSwitchDimmDown: Switches or dims the addressed devices down.

bOn: Switches the addressed devices to the most recent output value.

bOff: Switches the addressed devices off (value 0).

bSetDimmValue: A positive edge at this input sets the addressed devices immediately to the brightness value that is asserted at the nDimmValue input. If the value of nDimmValue changes, the brightness value is set immediately to the changed value if the bSetDimmValue input is FALSE.

nDimmValue: see bSetDimmValue.

tSwitchOverTime: Time for switching between the light on/off and dimming functions for the bSwitchDimm input.

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.

VAR_OUTPUT

nActualLevelMasterDev  : BYTE;
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).

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.