Use Waijung Blockset for SQLite data logger demo

<< Click to Display Table of Contents >>

Navigation:  STM32F4 Target > Demos > Hardware Modules Demos > aMG SQLite Data Server >

Use Waijung Blockset for SQLite data logger demo

Previous pageReturn to chapter overviewNext page

This demo showing to use Waijung blockset to communicate to aMG SQLite Data Server board.

Requirements

1. Log ADC data 2 channel, in format of voltage 0-3.3V.

2. Every 1 second interval and the record must include sample ID.

Hardware setup

Connection of "aMG SQLite Data Server" board to "F4 Connect" board.

amgsqlite_hwsetup2

Software setup

demo File: sqlite_adclogging_demo.mdl

amgsqlite_model_demo1

Number

Block name

Configuration

Description

1

Target Setup

(Use default configuration)

Configure Target name, compiler, etc..

2

SQLite Database Setup

- Select UART6 for communication port

- Timeout 5 seconds

- 4kbytes buffer

- Software reset control

SQLite connection configuration.

3

UART Setup

- Select UART module: 6

- Baud rate: 1000000

- Frame: 8-None-1

- Pin: C6/C7

- HW flow control: None

- Buffer: 1024/1024

Configure UART module for communication, used by SQLite block.

4

SQLite Database Query1

SQLite statement use for Create table (if not existing)

This block is for create table in database with specified column format.

5

Regular ADC

(Select ADC pin C4 and C4)

This block read ADC values as data type double.

6

SQLite Database Query

- Statement: INSERT

- SQLite table: sensors

This block will sent SQLite statement to to aMG SQLite Data Server board via UART port 6.

7

Counter Free-Running

- Number of Bites: 32

This block will generate increment number for every sample. Output of the block will use as sample ID.

Testing

1. Compile/ Build demo model file into target MCU board.

2. Let MCU run for a few minutes to store ADC data into database.

3. When all required data is collected, disconnect power of testing board. Disconnect SD Card from aMG SQLite Data Server board and insert into PC card reader, for analyze data.

Analyze database

1. Start windows command line prompt, cmd.exe:

amgsqlite_softwaretesting8

2. Change directory to the location of sqlite3.exe. Example: "C:\sqlite"

3. Run sqlite3.exe from windows command line, with specify database path.

amgsqlite_test1

4. Make SQLite query statement to see the data store in database. Example:

amgsqlite_test2

5. Save data to CSV file

amgsqlite_test3

amgsqlite_test4