FB_DALIV2Dimmer1SwitchMultiple

FB_DALIV2Dimmer1SwitchMultiple 1:

The function block FB_DALIV2Dimmer1SwitchMultiple is used to switch and dim DALI devices with a push button. For applications in which up to five DALI lines (0..4) can be installed. The basic function of this function block can be found in the description of FB_DALIV2Dimmer1Switch.

FB_DALIV2Dimmer1SwitchMultiple 2: Inputs

VAR_INPUT
  bSwitchDimm                  : BOOL;
  bOn                          : BOOL;
  bOff                         : BOOL;
  bSetDimmValue                : BOOL;
  nDimmValue                   : BYTE;
  tSwitchOverTime              : TIME := t#400ms;
  tCycleDelay                  : TIME := t#500ms;
  bMemoryModeOn                : BOOL := FALSE;
  nOnValueWithoutMemoryMode    : BYTE := 254;
  nAddr                        : BYTE := 0;
  eAddrType                    : E_DALIV2AddrType := eDALIV2AddrTypeShort;
  nMasterDevAddr               : BYTE := 0;
  nMasterDevLine               : BYTE := 0;
  nMinLevelMasterDev           : BYTE := 126;
  nMaxLevelMasterDev           : BYTE := 254;
  tCycleActualLevelMasterDev   : TIME := t#0s;
  nDALILineEnable              : BYTE := 2#0000_0001;
END_VAR

Name

Type

Description

bSwitchDimm

BOOL

Switches or dims the addressed devices.

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 input bSwitchDimm

tCycleDelay

TIME

Delay time, if either the minimum or maximum value is reached.

bMemoryModeOn

BOOL

Switches to the memory function, so that the previous value is written to the output as soon as it is switched on.

nOnValueWithoutMemoryMode

BYTE

Switch-on value if the memory function is not switched on.

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

nMasterDevLine

BYTE

The line on which the master device for group and common configurations is located. Depending on the function block, there is only one master device that is to be selected from one of the activated DALI lines. Lines 0 to 4 are available.

nMinLevelMasterDev

BYTE

Minimum value of the master device

nMaxLevelMasterDev

BYTE

Maximum value of the master device

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.

nDALILineEnable

 

Input variable in the form of a bit pattern. A 1 in the bit pattern indicates that the DALI line is activated. Example: 2#01001 means that DALI lines 0 and 3 are activated.

FB_DALIV2Dimmer1SwitchMultiple 3: Inputs/outputs

VAR_IN_OUT
  stCommandBuffer00 : ST_DALIV2CommandBuffer;
  stCommandBuffer01 : ST_DALIV2CommandBuffer;
  stCommandBuffer02 : ST_DALIV2CommandBuffer;
  stCommandBuffer03 : ST_DALIV2CommandBuffer;
  stCommandBuffer04 : ST_DALIV2CommandBuffer;
END_VAR

Name

Type

Description

stCommandBuffer00 - stCommandBuffer04

ST_DALIV2CommandBuffer

Reference to the internal structures for communication with the function blocks FB_KL6811Communication (KL6811) or FB_KL6821Communication (KL6821).

FB_DALIV2Dimmer1SwitchMultiple 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