C2000Ware Digital Power SDK  5.03.00.00
DLOG_4CH

Introduction

Data Structures

struct  DLOG_4CH
 Defines the Four Channel Data Logger (DLOG_4CH) structure. More...
 

Functions

static void DLOG_4CH_reset (DLOG_4CH *v)
 resets internal storage data More...
 
static void DLOG_4CH_config (DLOG_4CH *v, float32_t *inputPtr1, float32_t *inputPtr2, float32_t *inputPtr3, float32_t *inputPtr4, float32_t *outputPtr1, float32_t *outputPtr2, float32_t *outputPtr3, float32_t *outputPtr4, float32_t size, float32_t trigValue, float32_t preScalar)
 Configures DLOG_4CH module. More...
 
static void DLOG_4CH_run (DLOG_4CH *v)
 Run the DLOG_4CH module. More...
 

Typedefs

typedef float float32_t
 
typedef long double float64_t
 

Macros

#define C2000_IEEE754_TYPES
 

Four Channel Data Logger (DLOG_4CH) Module

Introduction

The Four Channel Data Logger (DLOG_4CH) API provides a set of functions that performs data logging to emulate an oscilloscope in software to graphically observe system variables.

This software module performs data logging over data stored in in a location pointed to by input_ptr 1-4. The input variable value is then stored in the array pointed to by output_ptr 1-4.

The data logger is triggered at the positive edge of the value pointed by the input pointer1. The trigger value is programmable by writing the trig_value to the module variable. The size of the data logger has to be specified and the module can be configured to log data every n number module call, by specifying a pre scalar value.

Four Channel Data Logger Model

API Usage

The following is a sequence of steps that can be followed to use the DLOG_4CH API library functions in an existing C program. For a set of code examples that illustrates the use of this library, see the examples in the Digial Power SDK.

Before you can using the library you must add the libraries directory path as a searchable directory in the project include options. This can be done by right-clicking on the project in the Project Explorer window, selecting "Properties". In the window that opens, navigate to "Build, C2000 Compiler, Include Options". In the include path
window, click on the green add directory path button on the right and enter the path to the Digital Power SDK libraries directory.

This allows CCS to search the entire directory for library files.

Once that is done you should follow these steps incorporate this library into your project:

  1. Specify the include file(s)
    #include "dlog_4ch.h"

  2. Create and add module structure to project source file
    Note: Also declare the buffers dBuff1/2/3/4 where the data is stored, assuming DBUFF_SIZE is the data buffer length desired.
    DLOG_4CH dLog1;
    float32_t dBuff1[DBUFF_SIZE];
    float32_t dBuff2[DBUFF_SIZE];
    float32_t dBuff3[DBUFF_SIZE];
    float32_t dBuff4[DBUFF_SIZE];

  3. Initialize module
    Note: Make sure to put the correct pointer addresses in the DBUFF structure. Assuming dval1/2/3/4 are the variables that need to be logged by the data buffer, the pre_scalar value is used to decimate the buffering of the data.
    DLOG_4CH_config(&dLog1, &dVal1, &dVal2, &dVal3, &dVal4, dBuff1, dBuff2, dBuff3, dBuff4, DBUFF_SIZE, (float32_t)(0.1), 1);

  4. Using the module
    Note: Make sure to call this routine in the ISR. The values buffered are written to dVal1/2/3/4.
    DLOG_4CH_run(&dLog1);

    Note: The functions are typically called in an interrupt source routine (ISR) which is called at the defined ISR frequency rate.

API Integration Information

There is only one module in this package, the APIs can be referenced at DLOG_4CH. The module headers are located at dlog_4ch.h.

Macro Definition Documentation

◆ C2000_IEEE754_TYPES

#define C2000_IEEE754_TYPES

Definition at line 48 of file dlog_4ch.h.

Typedef Documentation

◆ float32_t

typedef float float32_t

Definition at line 53 of file dlog_4ch.h.

◆ float64_t

typedef long double float64_t

Definition at line 54 of file dlog_4ch.h.

Function Documentation

◆ DLOG_4CH_reset()

static void DLOG_4CH_reset ( DLOG_4CH v)
inlinestatic

resets internal storage data

Parameters
*vThe DLOG_4CH structure pointer
Returns
None

Definition at line 87 of file dlog_4ch.h.

◆ DLOG_4CH_config()

static void DLOG_4CH_config ( DLOG_4CH v,
float32_t inputPtr1,
float32_t inputPtr2,
float32_t inputPtr3,
float32_t inputPtr4,
float32_t outputPtr1,
float32_t outputPtr2,
float32_t outputPtr3,
float32_t outputPtr4,
float32_t  size,
float32_t  trigValue,
float32_t  preScalar 
)
inlinestatic

Configures DLOG_4CH module.

Parameters
*vThe pointer to DLOG_4CH structure pointer
input_ptr1Pointer to data being buffered in the first buffer
input_ptr2Pointer to data being buffered in the second buffer
input_ptr3Pointer to data being buffered in the third buffer
input_ptr4Pointer to data being buffered in the fourth buffer
output_ptr1Pointer to where first array of buffered data is stored
output_ptr2Pointer to where second array of buffered data is stored
output_ptr3Pointer to where third array of buffered data is stored
output_ptr4Pointer to where fourth array of buffered data is stored
sizeData buffer size
trigValueTrigger point for the datalogger
preScalarVariable to skip data logging points
Returns
None

Definition at line 111 of file dlog_4ch.h.

◆ DLOG_4CH_run()

static void DLOG_4CH_run ( DLOG_4CH v)
inlinestatic

Run the DLOG_4CH module.

Parameters
*vThe DLOG_4CH structure pointer
Returns
None

Definition at line 146 of file dlog_4ch.h.

DLOG_4CH_reset
static void DLOG_4CH_reset(DLOG_4CH *v)
resets internal storage data
Definition: dlog_4ch.h:87
DLOG_4CH
Defines the Four Channel Data Logger (DLOG_4CH) structure.
Definition: dlog_4ch.h:65
float32_t
float float32_t
Definition: power_meas_sine_analyzer.h:54
DLOG_4CH_run
static void DLOG_4CH_run(DLOG_4CH *v)
Run the DLOG_4CH module.
Definition: dlog_4ch.h:146
dlog_4ch.h
DLOG_4CH_config
static void DLOG_4CH_config(DLOG_4CH *v, float32_t *inputPtr1, float32_t *inputPtr2, float32_t *inputPtr3, float32_t *inputPtr4, float32_t *outputPtr1, float32_t *outputPtr2, float32_t *outputPtr3, float32_t *outputPtr4, float32_t size, float32_t trigValue, float32_t preScalar)
Configures DLOG_4CH module.
Definition: dlog_4ch.h:111