FB_BARLightCircuit
This function block represents a simple light switching circuit without a dimming function.
The function block knows 3 different modes, which can be set via the input uiLightCtrlMode:
- Automatic mode
- Manual On mode
- Manual Off mode
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.
- 0: automatic mode, the output value lrDimmValue can be influenced by the command inputs bSwitch, bCentralOn and bCentralOff.
- 1: Manual On mode; the value 100.0 is output without a delay at the output lrDimValueOut, all other command inputs are ineffective.
- 2: Manual Off mode; the value 0.0 is output without a delay at the output lrDimValueOut, all other command inputs are ineffective.
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.
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.