6.6. Database

The database module is part of the Engine layer.

The database module allows the user to store and retrieve data. The database along with the diag module runs in the highest priority. This must not be changed.

A quick introduction on how to add additional information to the database is found here.

6.6.1. Module Files

Driver:
Driver Configuration:

6.6.2. Detailed Description

The DATA_Task() task is running with the highest priority inside the ENG_TSK_Engine.

To store and read data the database introduces two functions:

  • DB_WriteBlock(..) and
  • DB_ReadBlock(..).

6.6.2.1. Block Diagram

../../../_images/data1.png

Fig. 6.11 SendQueue

../../../_images/data2.png

Fig. 6.12 Timing

6.6.3. Configuration

The configuration of the database consists of the following parts:

6.6.3.1. database_cfg.h

  • Number of data blocks in DATA_BLOCK_ID_TYPE_e
  • Human understandable alias for the datablocks (e.g., DATA_BLOCK_ID_ALLGPIOVOLTAGE for DATA_BLOCK_22).
  • Typedefed struct of the actual data. This always consists of a timestamp, the previous timestamp and then the arbitrary data.

6.6.3.2. database_cfg.c

  • A variable for the database block DATA_BLOCK_ALLGPIOVOLTAGE_s data_block_ltc_allgpiovoltages[DOUBLE_BUFFERING];
  • The variable must be introduced to the database header variable DATA_BASE_HEADER_s  data_base_header[] = {..}.

6.6.4. Usage/Examples

For examples of usage and adaptions see: