FB_DALIV2Dimmer2SwitchEco

FB_DALIV2Dimmer2SwitchEco 1:

The function block FB_DALIDimmer2SwitchEco is the memory-saving variant of FB_DALIV2Dimmer2Switch. It is not equipped with the special function “Switch off memory 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.

Memory function

In contrast to FB_DALIV2Dimmer2Switch, where the memory function can be activated or deactivated via the input bMemoryModeOn, the memory function is always active in this memory-saving version. This means that the last-set value is adopted as the brightness value when switching on. It does not matter whether the light is switched via the input bOn or via the input bSwitchDimm.

Comment on the tSwitchOverTime parameter

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

Comment on the nMasterDevAddr parameter

The DALI system provides facilities not just for controlling lamps individually, but also for addressing them as groups or through common commands. Since the individual devices may belong to different groups, the individual lamps may have different brightness states before a group or common control command. 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.

FB_DALIV2Dimmer2SwitchEco 2: Inputs

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;
END_VAR

Name

Type

Description

bSwitchDimmUp

BOOL

Switches or dims the addressed devices up.

bSwitchDimmDown

BOOL

Switches or dims the addressed devices down.

bOn

BOOL

Switches the addressed devices to the last output value, or to the value nOnValueWithoutMemoryMode.

bOff

BOOL

Switches the addressed devices off (value 0).

bSetDimmValue

BOOL

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

nDimmValue

BYTE

see bSetDimmValue

tSwitchOverTime

TIME

Time for switching between the light on/off and dimming functions for the inputs bSwitchDimmUp and bSwitchDimDown

nAddr

BYTE

The address of a device or of a group

eAddrType

E_DALIV2AddrType

Short address, group address or broadcast

nMasterDevAddr

BYTE

The address of the master device (reference device) for group and common switching operations

tCycleActualLevelMasterDev

TIME

Cycle time required to read the current actual value in the background (see ACTUAL DIM LEVEL). 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.

FB_DALIV2Dimmer2SwitchEco 3: Inputs/outputs

VAR_IN_OUT
  stCommandBuffer : ST_DALIV2CommandBuffer;
END_VAR

Name

Type

Description

stCommandBuffer

ST_DALIV2CommandBuffer

Reference to the internal structure for communication with FB_KL6811Communication (KL6811) or FB_KL6821Communication (KL6821).

FB_DALIV2Dimmer2SwitchEco 4: Outputs

VAR_OUTPUT
  nActualLevelMasterDev : BYTE;
  bBusy                 : BOOL;
  bError                : BOOL;
  nErrorId              : UDINT;
END_VAR

Name

Type

Description

nActualLevelMasterDev

BYTE

Current output value of the master device (always the respectively addressed device if eAddrType = eAddrTypeShort)

bBusy

BOOL

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

bError

BOOL

This output is switched to TRUE as soon as 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 a command at the inputs.

nErrorId

UDINT

Contains the command-specific error code of the most recently executed command. Is reset to 0 by the execution of a command at the inputs (see error codes).

Requirements

Development Environment

PLC library to include

TwinCAT from v3.1.4020.14

Tc2_DALI from v3.4.3.0