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 ... IFbatModuleMounted()THEN batlvl :=batPowerLevel(); IF batlvl >-1AND batlvl <3THEN DebugFmt(message:="Battery level=\1",v1:=batlvl); END_IF; END_IF; ... END; END_PROGRAM;