FB_Dimmer1SwitchEco

FB_Dimmer1SwitchEco 1:

Description

The function-block FB_Dimmer1SwitchEco is the memory-saving variation on the FB_Dimmer1Switch(). It operates without the extra-functions "Set-Value" and "Memory-mode-off", which are not needed in many cases. In addition the values nOutMin and nOutMax of the FB_Dimmer1Switch() are set to 0 and 32767 internally. The resulting output range is exactly the range of an analogue-output-terminal. The input tPLCCycle is very important for the calculation of increments per cycle for the output nOut . This method saves additional time-calculations.

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 0 and 32767. 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 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 memory function

Unlike the function-block FB_Dimmer1Switch(), which can operate with or without memory-function, this function is always activated in this variation. This means, that the light will, when turned on, always be set to the last on-level. How the light was turned on, either with the input bSwitchDimm or with the input bOn , doesn´t matter.

FB_Dimmer1SwitchEco 2:

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.

VAR_INPUT

bSwitchDimm        : BOOL;
bOn                : BOOL;
bOff               : BOOL;
tSwitchOverTime    : TIME := t#500ms;
tDimmTime          : TIME := t#5s;
tCycleDelay        : TIME := t#500ms;
tPLCCycle          : TIME := t#10ms;

bSwitchDimm: Switches or dims the output.

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

bOff: Switches the output to 0.

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

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.

tPLCCycle: PLC-Cycle time.

VAR_OUTPUT

nOut               : UINT;
bLight             : BOOL;

nOut: Analogue output-value.

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