pmExternalPower (Function)

Top  Previous  Next

Architecture:

NX32 / NX32L

Firmware version:

4.00 / 1.00.00


Turns the external power on and off. This makes it possible to run on battery even though external power is provided.

If battery backup is not enabled or if BatPowerLevel() is at the lowest level, the external power can not be disabled.

Note: This function is not supported on LX4.

 

 

Input:

enable: BOOL

Enables/disables the external power.

 

Returns:

0

- Success.

1

- Battery backup not enabled.

2

- Battery power too low.

3

- Not supported.

 

Declaration:

FUNCTION pmExternalPower : INT;
VAR_INPUT
   enable   : BOOL;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
BEGIN
   ...
   // Turn off external power
   pmExternalPower(enable := FALSE);
   ...
END;
 
END_PROGRAM;