---
title: "Batteries"
canonical: "https://docs.cuesystem.com/space/CVCHELP/510591202/Batteries"
format: markdown
---
> Macro (toc)

---

# CalibrateMainBattery 

This function provides calibration of the main battery. It performs complete charging and discharging cycle to get recent battery conditions. At first, the battery is completely charged and it is necessary to be connected to the external power supply during this period. When the battery is fully charged the discharge period starts. During this period the main battery capacity is evaluated. To minimize the time of this period all power savers are switched off and display brightness is set to maximum. When the battery is discharged the power savers and display brightness are set to the original values. 

The function returns **True** when the main battery capacity was evaluated. At this time the main battery is fully discharged. It is recommended to use a wait cycle with the function IsMainBatteryCharged for charging the main battery again. 

#### Syntax 

```visualbasic
Function CalibrateMainBattery () As Boolean
```

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u>  

**True** on success 

**False** if some error occurs. The function GetLastError returns the error number that occurred while executing the command. The following errors may occur: <u>[155](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#155)</u>, <u>[156](/wiki/spaces/CVCHELP/pages/510525445/Command+errors#156)</u>. 

#### Example 

```visualbasic
If CalibrateMainBattery() Then 

Do 

   Wait (:30.0) 

  Loop While Not IsMainBatteryCharged() 

Else 

//error handling 

End If
```

# GetMainBatteryCapacity 

This function returns the capacity of the main battery in coulombs. Value is obtained during main battery calibration. The coulomb is the unit of electric charge. It is defined as the charge transported by a steady current of one ampere in one second, for example, 3600 coulombs = 1 ampere-hour. See the table below for the nominal capacity of the new main battery. It is recommended to replace the battery when capacity is below 50% of nominal capacity. 

#### Syntax 

```visualbasic
Function GetMainBatteryCapacity () As Double
```

#### Return value 

<u>[Double](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> It is the main battery capacity in coulombs 

|  |  |
| --- | --- |
| Device | Nominal capacity of new main battery |
| airCUE-7 | 6 480 coulombs (1 800 mAh) |

# GetMainBatteryCurrent 

This function returns the recent current of the main battery in amperes. A positive number means charging, a negative number means discharging the main battery. 

#### Syntax 

```visualbasic
Function GetMainBatteryCurrent () As Double
```

#### Return value* *

<u>[Double](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> It is the main battery’s recent current in amperes. 

# GetMainBatteryCharge 

This function returns the recent charge of the main battery in coulombs. The coulomb is the unit of electric charge. It is defined as the charge transported by a steady current of one ampere in one second, for example, 3600 coulombs = 1 ampere-hour. 

#### Syntax 

```visualbasic
Function GetMainBatteryCharge () As Double
```

#### Return value* *

<u>[Double](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> It is the recent main battery charge in coulombs. 

# GetMainBatteryVoltage 

This function returns the voltage of the main battery in volts. 

#### Syntax 

```visualbasic
Function GetMainBatteryVoltage () As Double
```

#### Return value 

<u>[Double](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> It is recent main battery voltage in volts. 

# GetMainPowerVoltage 

This function returns the voltage of the external power supply in volts. If the external power supply is not connected the function returns a value between 0 and 0.5 volts. 

#### Syntax 

```visualbasic
Function GetMainPowerVoltage () As Double
```

#### Return value 

<u>[Double](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> It is recent external power supply voltage in volts. 

# GetRTCBatteryVoltage 

This function returns the voltage of the Real Time Clock (RTC) backup battery in volts. If the RTC battery is in good condition, the function returns a value between the minimum and maximum voltage – see table below. 

> ⚠️ This function is supported on touchCUE panels in revisions 1 - 9 . On touchCUE panels in revisions 22 and higher, the function always returns a value 0.0

#### Syntax 

**Function** GetRTCBatteryVoltage () **As Double** 

#### Return value 

<u>[Double](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Double)</u> It is a recent RTC backup battery voltage in volts. 

|  |  |  |
| --- | --- | --- |
| Device | Minimum voltage | Maximum voltage |
| airCUE-7 | 2.5 V | 3.2 V |
| touchCUE-7, -7-B, -7-W<br>**(only revision 1-9)** | 2.5 V | 3.2 V |
| touchCUE-12, -12-B, -12-W<br>**(only revision 1-9)** | 2.5 V | 3.2 V |
| uniCUE-7, -12 | 2.5 V | 3.2 V |
| controlCUE-one, -two | 2.5 V | 3.2 V |

# IsMainBatteryCharged 

This function returns **True** if the main battery is fully charged and vice versa. 

#### Syntax 

**Function** IsMainBatteryCharged () **As Boolean** 

#### Return value 

<u>[Boolean](/wiki/spaces/CVCHELP/pages/495058958/Data+types#Boolean)</u>  

**True** when the main battery is fully charged. 

**False** when the main battery is not fully charged.