This sets whether the LCD displays will turn on when external power is present. This has the same effect as setting the LCD display power in Device: Configuration: Power / Battery.
Note: The power state is retained across power down.
On the NX-400 and the LX4, the display can be configured to automatically reduce the intensity of the backlight, when the display is not being actively used. When a key or the display is clicked, a dialog or form is shown or displayBacklightWake is called, it will restore the backlight to the previous level. The backlight changes are available via displayGetKey.
The values for autoOff and offLevel are kept across power down and will be used as the new default values.
Note: offLevel is not used on LX4 as it does not have variable backlight intensity and it will always turn it completely off if autooff is enabled.
Input:
power : BOOL
TRUE:
|
The display will turn ON when external power is present.
|
FALSE:
|
The display will remain OFF when external power is present.
|
autoOff : INT default -1
>0
|
Auto off is enabled, the backlight will turn off when the specified number of seconds has elapsed without the display being used.
|
0:
|
Auto off is disabled, the backlight will stay on as long as the display is powered.
|
-1:
|
Leave it at the default value.
|
offLevel : SINT(1..100) default -1
0..100:
|
The backlight intensity level to switch to when turning the backlight off. Use 0 to turn the backlight completely off, use a larger value to keep it powered. Only used on NX-400.
|
-1:
|
Leave it at the default value.
|
Returns:
None.
Declaration:
FUNCTION displayPower;
VAR_INPUT
power : BOOL;
offLevel : SINT := -1;
autoOff : INT := -1;
END_VAR;
Example:
INCLUDE rtcu.inc
PROGRAM test;
displayPower(power := ON);
BEGIN
...
END;
END_PROGRAM;
|