batConsumptionEnable (function)

Top  Previous  Next

Architecture:

X32

Device support:

SX1

Firmware version:

2.70


This function controls whether the battery current consumption measurement circuit is enabled or disabled.

As the power consumption circuit itself uses power, it is recommended to disable it when not used. Default state is disabled.

 

The battery current consumption measurement is automatically suspended while in power saving modes such as pmWaitEvent but not while running at lower speeds.

The power consumption used when entering power saving modes such as pmWaitEvent are not included in the measurement.

 

 

Input:

enable : BOOL (false/true)

TRUE:

Enables the current consumption measurement.

FALSE:

Disables the current consumption measurement.

 

Returns:

None.

 

Declaration:

FUNCTION batConsumptionEnable;
VAR_INPUT
  enable : BOOL;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM example;
 
  // Start the current consumption measurement
  batConsumptionEnable(enable := ON);
 
BEGIN
  ...
END;
END_PROGRAM;