FB_Dimmer1SwitchEco function block

FB_Dimmer1SwitchEco function block 1:
FB_Dimmer1SwitchEco

Description

The FB_Dimmer1SwitchEco block is a variant of FB_Dimmer1Switch that saves memory space. It lacks the special functions Set brightness value and Disable 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: 200 ms). The output signal moves cyclically between 0 and 32767. In order to be able to better adjust the maximum or minimum value, the output signal dwells at the minimum or maximum value for the time 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. For example, for global on/off functions. The output value is set to 0 when switching off.

Memory function

Unlike FB_Dimmer1Switch, in which the memory function can be activated or deactivated via the bMemoryModeOn input, the memory function is always active in this version for saving memory space. 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 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;
tDimmTime         :  TIME;
tCycleDelay        :  TIME;
tPLCCycle               :  TIME;

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.

Download

Click on the following symbol to download the file with the FB_Dimmer1SwitchEco function block from this documentation.

FB_Dimmer1SwitchEco function block 2: Download FB_Dimmer1SwitchEco.exp.zip

Save the FB_Dimmer1SwitchEco.exp file contained in this zip file on your PC.

FB_Dimmer1SwitchEco function block 3:

Importing a function block

The import of a function block into your TwinCAT system is described in the chapter Importing a function block.

fb_dimmer1switcheco.exp.zip