# F(t) generation and SQL recording

The purpose of this [last exemple](https://github.com/elc-construction-electronique/Librairie-Python-ALR32XX/blob/main/Exemples/Exemple_3.py) is to control the supply voltage to the ALR3203 to create any low frequency signal. This signal will be requested point by point from the user and stored in an [SQL](https://docs.python.org/3/library/sqlite3.html) database.&#x20;

#### Adding the library and initializing

As in the previous example, the development libraries are added and the power supply variable is created.

```python
import sys 
import math
import sqlite3
sys.path.insert(0, "..")
from ALR32XX.ALR32XX import*
```

{% hint style="info" %}
The *sys*, *math* and *sqlite3* libraries do not require additional installation.
{% endhint %}

To complete the initialization of the procedure, we need to declare a variable for our power supply:

```bash
X=ALR32XX('ALR3203')
```

Here, the variable X will be linked to the ALR3203 connected via USB or RS232 to the computer. X therefore inherits functions from the library, for example X.Mesure\_tension() to measure the voltage on the power supply channel.

#### Creation of the database

The program concerning the management of the database will not be detailed. The principle is to create a database with the index, the requested voltage and the time value, to record the number of points desired and to come and ask each point to the user:

![](https://1772586357-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mk6VnTs-J9312_UKt_v%2F-MlPhYqCaruYgS5ZcPEB%2F-MlPhcIU6WLMVoCiNhhr%2Fexemple_aleat.PNG?alt=media\&token=53fdbe7f-8fe5-49ac-8820-996652edb01d)

#### Signal creation

The information is stored in two lists which are browsed item by item to create the signal (as in the previous example).

By connecting the output of the power supply to an oscilloscope, the plot can be displayed:

![](https://1772586357-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mk6VnTs-J9312_UKt_v%2F-MlPhYqCaruYgS5ZcPEB%2F-MlPi5Cz_cOMooklsq0Q%2Fexemple_aleat_scope.png?alt=media\&token=857d714e-52b8-443e-bde1-dd6482ec57c5)
