FB_Dimmer3Switch

FB_Dimmer3Switch 1:

Description

The functions available in the FB_Dimmer3Switch function block correspond closely to those in FB_Dimmer1Switch() and FB_Dimmer2Switch().

Operating by means of the bSwitchDimm input

The light is switched on or off by a short signal at the bSwitchDimm input. Dimmer mode will be activated if the signal remains for longer than tSwitchOverTime (typical recommended value: 200ms). The output signal then cycles between nOutMin and nOutMax. In order to be able to set the maximum or minimum value more easily, the output signal pauses at the level of the maximum and minimum values for the time given by tCycleDelay. When the signal is once more removed, the output signal being generated at that time is retained. Another pulse at the input will set the output to 0.

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 output signal goes to nOutMin or nOutMax. 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. This may, for instance, be used for global on/off functions. The output value is set to 0 when switching off. The switch-on behaviour can be affected by the memory function (see below).

Operation by means of the bSetDimmValue and nDimmValue inputs

If the value of nDimmValue changes, the signal will be passed through directly to the output. The significant point here is that the value changes. The lighting is switched off by changing the value to 0. If there is a rising edge at the bSetDimmValue input, the value of nDimmValue immediately appears at the output. Immediate modification of the output can be suppressed by a static 1- signal at the bSetDimmValue input. This makes it possible to apply a value to the nDimmValue input, but for this value only to be passed to the output at the next rising edge of bSetDimmValue.
The bSetDimmValue and nDimmValue inputs can be used to implement a variety of lighting scenarios. Using nDimmValue to set the outputs directly can be used to achieve particular brightness levels, either directly or by continuously changing the value. nDimmValue must have a value between nOutMin and nOutMax. The value 0 is an exception. If the value is outside this range, the output value is limited to the upper or lower limit, as appropriate.

The memory function

It is necessary to determine whether the memory function (bMemoryModeOn input) is active or not at switch-on. If the memory function is active, then the last set value is placed at the output as soon as the lamp is switched on. If the memory function is not active, then the value specified by the nOnValueWithoutMemoryMode parameter is output. It is irrelevant, in this case, whether the light it has been switched on by means of the bOn input or one of the bSwitchDimmUp or bSwitchDimmDown inputs. It should be noted that the nOnValueWithoutMemoryMode parameter must lie between nOutMin and nOutMax. If this is not the case, the output value is adjusted to the upper or lower limit, as appropriate.

Fast dimming up/down when switching on and off

Lighting is particularly pleasant if sudden changes are replaced by a slow change to the desired value. This mode can be activated both for switching on and for switching off by means of the two inputs, bDimmOnMode and bDimmOffMode. The tDimmOnTime and tDimmOffTime parameters specify the time that will be taken by the switching processes. This value is always related to the minimum and maximum possible output values (nOutMin and nOutMax). The bOn and bOff inputs are one way in which the switch on/off commands may be given. Alternatively, a short pulse can be provided to either of the inputs bSwitchDimmUp or bSwitchDimmDown. If the nDimmValue input is set to 0, the output is modified without delay. The same is true if the output is set by a rising edge at the bSetDimmValue input.

FB_Dimmer3Switch 2:

Comments on the tSwitchOverTime and tDimmTime parameters

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

If the tDimmTime parameter is 0, the bSwitchDimmUp or bSwitchDimmDown inputs can only be used to switch the light on or off. In this case, the value of tSwitchOverTime is irrelevant.

VAR_INPUT

bSwitchDimm                : BOOL;
bSwitchDimmUp              : BOOL;
bSwitchDimmDown            : BOOL;
bOn                        : BOOL;
bOff                       : BOOL;
bSetDimmValue              : BOOL;
nDimmValue                 : UINT;
tSwitchOverTime            : TIME := t#500ms;
tDimmTime                  : TIME := t#5s;
tCycleDelay                : TIME := t#10ms;
bMemoryModeOn              : BOOL := FALSE;
nOnValueWithoutMemoryMode  : UINT := 20000;
bDimmOnMode                : BOOL := FALSE;
tDimmOnTime                : TIME := t#0s;
bDimmOffMode               : BOOL := FALSE;
tDimmOffTime               : TIME := t#0s;
nOutMin                    : UINT := 5000;
nOutMax                    : UINT := 32767;

bSwitchDimm: Switches or dims the output.

bSwitchDimmUp: Switches or dims the output Up.

bSwitchDimmDown: Switches or dims the output Down.

bOn: Switches the output to the last output value, or to the value specified by nOnValueWithoutMemoryMode.

bOff: Switches the output to 0.

bSetDimmValue: Switches the output to the value nDimmValue.

nDimmValue: The value is immediately applied to the output when there is a change.

tSwitchOverTime: Time for switching between the light on/off and dimming functions for the bSwitchDimmUp and bSwitchDimmDown inputs.

tDimmTime: Time required for dimming to go from its minimum value to its maximum value.

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.

bDimmOnMode: The output value is increased in steps when switching on.

tDimmOnTime: Period over which the light is turned up when switching on. bDimmOnMode must be active.

bDimmOffMode: The output value is reduced in steps when switching off.

tDimmOffTime: Period over which the light is turned down when switching off. bDimmOffMode must be active.

nOutMin: Minimum output value.

nOutMax: Maximum output value. If the parameter nOutMin is not smaller than nOutMax, the output will remain at 0.

VAR_OUTPUT

nOut            : UINT;
bLight          : BOOL;

nOut: Analogue output-value.

bLight: Digital output-value. This bit is set if nOut is above 0.