batPowerLevel (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

1.00 / 1.00.00


batPowerLevel will return the power level of the backup battery.

 

 

Input:

None

         

Returns: SINT

-1

- Error.

0-5

- Power level, where 5 is maximum power.

 

Declaration:

FUNCTION batPowerLevel : SINT;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  batlvl : SINT;
END_VAR;
 
BEGIN
  ...
  IF batModuleMounted() THEN
     batlvl := batPowerLevel();
    IF batlvl > -1 AND batlvl < 3 THEN
        DebugFmt(message:="Battery level=\1",v1:=batlvl);
    END_IF;
  END_IF;
  ...
END;
 
END_PROGRAM;