FB_DALIV2Dimmer1SwitchMultiple

FB_DALIV2Dimmer1SwitchMultiple 1:

Function block for switching and dimming DALI devices with one 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().

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;

bSwitchDimm: Switches or dims the addressed devices on all the activated DALI lines.

bOn: Switches the addressed devices on all the activated DALI lines to the last output value, or to the value specified by nOnValueWithoutMemoryMode.

bOff: Switches the addressed devices on all the activated DALI lines off (value 0).

bSetDimmValue: A positive edge at this input sets the addressed devices on all the activated DALI lines 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.

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

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

nOnValueWithoutMemoryMode: Value at switch on if the memory function is not active.

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 (0 - 63).

nMasterDevLine: 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. The lines are numbered from 0 to 4.

nMinLevelMasterDev: The minimum value of the master device.

nMaxLevelMasterDev: The maximum value of the master device.

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.

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

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

arrCommandBuffer       : ARRAY [0..4] OF ST_DALIV2CommandBuffer;

arrCommandBuffer: A reference to the internal structures for communication with the FB_DALIV2Communication() (KL6811) or FB_KL6821Communication() (KL6821) block.