FB_BARLightCircuit

This function block represents a simple light switching circuit without a dimming function.

FB_BARLightCircuit 1:

The function block knows 3 different modes, which can be set via the input uiLightCtrlMode:

In automatic mode (uiLightCtrlMode=0) the function block can be controlled via the inputs bSwitch, bCentralOff and bCentralOn. A rising edge on bCentralOff switches the output lrDimValue to 0.0, while a rising edge on bCentralOn sets the output to 100.0. Rising edges on bSwitch make the output lrDimValue change each time between 0.0 and 100.0.

In manual operation modes, when uiLightCtrlMode=1, the output value lrDimValueOut is constantly set to the value 100.0 and when uiLightCtrlMode=2, the output value is constantly set to the value 0.0.

VAR_INPUT

uiLightCtrlMode: UINT;
bSwitch        : BOOL;
bCentralOn     : BOOL;
bCentralOff    : BOOL;

uiLightCtrlMode : operation mode.

bSwitch: rising edges on bSwitch make the output lrDimValue change each time between 0.0 and 100.0.

bCentralOn: switches the output lrDimValueOut to 100.0.

bCentralOff: switches the output lrDimValueOut to 0.0.

FB_BARLightCircuit 2:

All switching commands, bSwitch, bCentralOn and bCentralOff are effective only in automatic mode.

VAR_OUTPUT

lrDimValue  : LREAL;
bLight      : BOOL;
bError      : BOOL;
udiErrorId  : UDINT;

lrDimValue : light output value in percent 0.0, if the light is switched off and 100.0 if the light is switched on.

bLight : FALSE, if lrDimmValue = 0.0, otherwise TRUE.

bError: this output is switched to TRUE if the parameters entered are erroneous.

udiErrorId : contains the error code if the values entered should be erroneous. See error codes.