(Working) Code to interface 3 LoadCells to ADISense1000 and display values using the Labview code.

Fork of 4Bridge_ADISense1000_Example_copy by CAC_smartcushion

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers sample_lut_data.c Source File

sample_lut_data.c

00001 /*
00002  * File: sample_lut_data.c
00003  * The following example illustrates how individual tables can be declared, and
00004  * later assembled into a complete LUT data structure using adi_sense_1000_AssembleLutData().
00005  * That LUT data structure can then be written to the ADI Sense 1000 device 
00006  * using adi_sense_1000_SetLutData().
00007  */
00008 
00009 #include "adi_sense_1000_lut_data.h"
00010 #include "adi_sense_1000_sensor_types.h"
00011 
00012 /*
00013  * The following table provide linearisation data for a 4-wire bridge sensor
00014  * identified with the ADI_SENSE_1000_ADC_SENSOR_BRIDGE_4WIRE_1_DEF_L2
00015  * sensor type.  The Look-Up Table provided maps a range of input (X)
00016  * values to a corresponding range of output (Y) values.  In this example,
00017  * the bridge sensor input in millivolts is effectively translated to volts.
00018  */
00019 
00020 ADI_SENSE_1000_LUT_DESCRIPTOR bridge_4wire_1_def_l2_range1_desc = 
00021 {
00022     .geometry = ADI_SENSE_1000_LUT_GEOMETRY_NES_1D,
00023     .equation = ADI_SENSE_1000_LUT_EQUATION_LUT,
00024     .dir = ADI_SENSE_1000_LUT_TC_DIRECTION_FORWARD,
00025     .sensor = ADI_SENSE_1000_ADC_SENSOR_BRIDGE_4WIRE_2_DEF_L2 ,
00026     .dataType = ADI_SENSE_1000_LUT_DATA_TYPE_FLOAT32,
00027     .length = 0, /* Filled by adi_sense_1000_AssembleLutData() */
00028     .crc16 = 0   /* Filled by adi_sense_1000_AssembleLutData() */
00029 };
00030 
00031 ADI_SENSE_1000_LUT_1D_NES bridge_4wire_1_def_l2_range1_data = 
00032 {
00033     .nElements = 2,
00034     .lut = 
00035     {
00036         -3300.0f, /* x(min) */
00037         +3300.0f, /* x(max) */
00038         -3300.0f,    /* y(min) */
00039         +3300.0f,    /* y(max) */
00040     },
00041 };
00042 
00043 /*
00044  * The following variables can be passed as parameters to
00045  * adi_sense_1000_AssembleLutData()
00046  */
00047 ADI_SENSE_1000_LUT_DESCRIPTOR *sample_lut_desc_list[] = 
00048 {
00049 
00050     &bridge_4wire_1_def_l2_range1_desc,
00051     
00052 };
00053 
00054 ADI_SENSE_1000_LUT_TABLE_DATA  *sample_lut_data_list[] = 
00055 {
00056     
00057     (ADI_SENSE_1000_LUT_TABLE_DATA  *) &bridge_4wire_1_def_l2_range1_data,
00058     
00059 };
00060 
00061 unsigned sample_lut_num_tables =
00062     (sizeof(sample_lut_desc_list) / sizeof(sample_lut_desc_list[0]));
00063