Simple data logging test incorporating datalog library with user configurable parameters as follows:
| Parameters | Values |
|---|---|
| Number of data log channels | 4 |
| Buffer size | 400 |
| Data type | 32bit floating point |
| Trigger type | Auto trigger |
| Trigger Value | 5.0 |
| Prescalar/size | 1 |
This example verifies data logging capability and showcases datalog API usage. In this example, one float variable (i) will be incremented by "1" in every loop starting with "0" and with trigger value as "5". The *iptr[0] value will be monitored with auto trigger type and if it crosses the trigger value, data logging is initiated and values provided to *iptr[] will be logged for every prescalar loop.
In datalog_input.h, users can use the following defines as per data type:
| Data type | Defines |
|---|---|
| 32 bit signed integer | u_int32_t |
| 32 bit unsigned integer | u_uint32_t |
| 64 bit signed integer | u_int64_t |
| 64 bit floating point | u_float64_t |
| 32 bit floating point | u_float32_t |
| 16 bit signed integer | u_int16_t |
| 16 bit unsigned integer | u_uint16_t |
| 8 bit signed integer | u_int8_t |
| 8 bit unsigned integer | u_uint8_t |
| Folder/Files | Description |
|---|---|
| main.c | Main function for datalog library testing |
| datalog_test.c | Contains all initialization of test structures and variables with datalog functionality |
| datalog.c | datalog library source file |
| datalog.h | datalog library header file at "${SDK_INSTALL_PATH}/source/rtlibs/utilities/datalog/include" |
| datalog_input.h | User configurable datalog header file needed to be changed at "${SDK_INSTALL_PATH}/source/rtlibs/utilities/datalog/include" |
| datalog.syscfg | syscfg file for application |
Shown below is a sample output when the application is run and datalog output is observed in datalogBuff[][]: