FB_BAFLampDALI

FB_BAFLampDALI 1:

Function-block for controlling a DALI Lamp directly out of the PLC-program.

VAR_INPUT

uiId                             : UINT;
bStartExecution                  : BOOL;
bStopExecution                   : BOOL;
bOn                              : BOOL;
bOff                             : BOOL;
bCallMinControlValue             : BOOL;
bCallMaxControlValue             : BOOL;
bSetControlValueDirect           : BOOL;
lrSetControlValueDirect          : LREAL;
bFadeUp                          : BOOL;
bFadeDown                        : BOOL;
bChangeMaximumControlValue       : BOOL;
lrChangeMaximumControlValue      : LREAL
bChangeMinimumControlValue       : BOOL;
lrChangeMinimumControlValue      : LREAL;
bSetOperatingHourCounterDirect   : BOOL;
udiSetOperatingHourCounterDirect : UDINT;

uiId: Object id of the instance (see object id).

bStartExecution: Starts the instance of the lamp.

bStopExecution: Stops the instance of the lamp.

bOn: If iResettingMode = 1: The control value will be set to the previously stored lrResettingValue. Then this value will be internally adjusted to the DALI-range (0..254) and sent to the lamp with the DALI-command DIRECT ARC POWER.
If iResettingMode = 0: The DALI-Command RECALL MAX LEVEL will be sent.

bOff: If iResettingMode = 1: The lamp will be turned off by sending the DALI-command OFF. Before, the control value will be stored in lrResettingValue.
If iResettingMode = 0: The lamp will be turned off without saving the last control-value.

bCallMinControlValue: The DALI-command RECALL MIN LEVEL will be sent.

bCallMaxControlValue: The DALI-command RECALL MAX LEVEL will be sent.

bSetControlValueDirect: The control-value of the lamp will be set to lrSetControlValueDirect.

lrSetControlValueDirect: If bSetControlValueDirect is set, the value (0% - 100%) will be internally adjusted to the DALI-Range (0 - 254) and then sent to the lamp with the DALI-command DIRECT ARC POWER.

bFadeUp: The DALI-command UP will be sent.

bFadeDown: The DALI-command DOWN will be sent.

bChangeMaximumControlValue: The maximum control value of the lamp will be set to lrChangeMaximumControlValue.

lrChangeMaximumControlValue: Level (0% - 100%) to which the lamps maximum control level will be set, depending on the state of bChangeMaximumControlValue.

bChangeMinimumControlValue: The minimum control value of the lamp will be set to lrChangeMinimumControlValue.

lrChangeMaxMinControlValue: Level (0% - 100%) to which the lamps minimum control level will be set, depending on the state of bChangeMinimumControlValue.

bSetOperatingHourCounterDirect: The operating hours counter for the lamp is set to udiSetOperatingHourCounterDirect.

udiSetOperatingHourCounterDirect: The value to which the operating hours counter for the lamp is set by the input bSetOperatingHourCounterDirect set. Unit is seconds.

VAR_OUTPUT

uiErrorId                : UINT;
iErrorParameter          : INT;
eExecutionState          : E_BAF_ExecutionState;
lrControlValue           : LREAL;
lrResettingValue         : LREAL;
bReachedMinControlValue  : BOOL;
bReachedMaxControlValue  : BOOL;
udiOperatingHourCounter  : UDINT;

uiErrorId: Contains the error code of the last executed command (see Error codes).

iErrorParameter: Contains the specific parameter of the error code (see Error codes).

eExecutionState: Contains the actual execution state of the instance of the lamp.

lrControlValue: The control value (0% - 100%) of the lamp.

iResettingValue: The resetting value (0% - 100%) of the lamp.

bReachedMinControlValue: The control value of the lamp lrControlValue is equal to the parameter lrMinControlValue.

bReachedMaxControlValue: The control value of the lamp lrControlValue is equal to the parameter lrMaxControlValue.

udiOperatingHourCounter: operating hours counter for the lamp. Unit is seconds.