FB_Dimmer1SwitchEco

FB_Dimmer1SwitchEco 1:

This function block is a memory-saving variant of FB_Dimmer1Switch(). It does not have the special functions "Set brightness value" and "Switch off memory function", which may not be required for many applications. Moreover, the values nOutMin and nOutMax of the FB_Dimmer1Switch() are set internally here to 0 and 32767 respectively. This output span corresponds to the display range of an analog output terminal. The tPLCCycle input is important. This time is used to calculate internally the amount by which the nOut output must be increased per cycle - that 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 moves cyclically 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 positive edge is applied to the bOn or bOff inputs. For example, for global on/off functions. The output value is set to 0 when switching off.

The memory function

In contrast to FB_Dimmer1Switch(), 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 is irrelevant, in this case, whether the light it has been switched on by means of the bOn input or the bSwitchDimm input.

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: the set PLC cycle time.

VAR_OUTPUT

nOut               : UINT;
bLight             : BOOL;

nOut: analog output value.

bLight: digital output value. This is set if nOut is greater than 0.

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4020.32

Tc2_BABasic from v3.1.0.0