Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect gain on DAQmx AI task?

I have a simple analog input task configured to aquire a voltage level on a 16-bit M series board at 50 kHz in NRSE mode.  The device that the board is measuring outputs a voltage from 0 to 1.5 volts.  Becuase I have a number of parallel tasks, I'm interested in optimum throughput an minimum memory usage, so I use the raw version of AI Read (I16 output) rather than AI Read (volts), which outputs floating point doubles.  Later on (offline), I'd like to convert these raw I16 ADC values to the approprate voltage for further processing.  This involves knowing the gain of the ADC.

When I configure the AI task, I leave the min/max range inputs unwired, meaning they default to +/- 5 volts.  I assume this means that the ADC gain is set to make +/- 5 volts the maximum allowable digitization level.  Therefore, I determined that if I divide the raw I16 values by 6553.4, I should get the appropriate voltage that I'm looking for.  This is because the I16 range is [-2^15, 2^15-1], and thus:

Voltage = Raw value x (5/(2^15-1) volts/bit).

However, I seem to be getting inaccurate results.  For example, when I set the device to output 1.26 volts (confirmed independently by a multimeter), the measured raw value from AI Read is approximately 7760, which corresponds to 1.18 volts by the above equation.  If I indeed use AI Read (volts) or use MAX to read the voltage, I get the appropriate value of 1.26.  This leads me to think my assumption about the ADC gain is incorrect.

Is there a way to determine the appropriate formula for converting raw AI data to voltage?  Is my assumption about the gain incorrect?
0 Kudos
Message 1 of 3
(3,067 Views)
M series boards apply calibration while converting to floating point; thus binary data acquired from the board is uncalibrated. You can read the board's calibration constants with a DAQmx Channel property node after the range is set. The property you want is called AI Device Scaling Coefficients. At least in my version of DAQmx, it's under Analog Input -> General Properties -> Advanced -> Device Scaling Coefficients. This is an array of scaling coefficients that will include at least offset and gain, and possibly some polynomial correction as well, depending on which board you have. It's easy to apply the coefficients using one of the polynomial evaluation VIs.

Hope this helps,
Chris
0 Kudos
Message 2 of 3
(3,049 Views)
Hi Yuri33,

 In addition to the great response that Chris R. gave, I'd like to add that the procedure for converting from Raw  to Scaled values is documented in a KB which can be found here.

 There is a example in the KB referenced above, this illustrates how to convert the Raw to a Scaled value.

 Have a great afternoon!

 Best regards,

 MatthewW
 Applications Engineer
 National Instruments


 

0 Kudos
Message 3 of 3
(3,041 Views)