Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

AnalogUnscaledReader gives somewhat different reading than AnalogMultiChannelReader

I compared the AnalogUnscaledReader with the AnalogMultiChannelReader and found that they were about 6 % different, with AnalogUnscaledReader giving the lower reading. I'm simply measuring a constant +0.6 volts, in differential mode between channels AI 8 and AI 0.
 
I've attached some example code which gave me the result. It was derived from the AcqVoltageSamples_IntClk example provided with NiDAQmx 8.0.1, which I am currently using.
 
Does anyone know what's wrong?
 
Tim
0 Kudos
Message 1 of 4
(2,998 Views)
Hello Tim,

Good news, it's probably not something wrong with your board or your code.  The difference is described in the DAQmx C Reference Help, located in Program Files >> National Instruments >> NI-DAQ, under NI-DAQmx Concepts >> NI-DAQmx Key Concepts >> Reading and Writing Data >> Data Format and Organization >> Unscaled Data.  If you are using a M-Series or AO device, AnalogUnscaledReader returns data that is not calibrated and the MultiChannelReader returns data that is calibrated.

Regards,
Micaela N
National Instruments
0 Kudos
Message 2 of 4
(2,975 Views)

Thanks Micaela,

Somehow I suspected that. Is there a more elegant way to get calibrated unscaled data other than performing a post-acquisition calculation to translate the double variable returned from AnalogMultiChannelReader back into a 16 bit number? Ulimately, my data will be stored in a database and it would be a lot more efficient to store it as a 16 bit unsigned integer (my values will always be positive) rather than a real or floating point number.

Tim

0 Kudos
Message 3 of 4
(2,967 Views)
Hello Tim,

Returning a double is not as efficient for a database; however, the NI-DAQmx driver returns only the calibrated data in waveform or floating point data types.  This is described in the Data Formats section of the NI-DAQmx C Reference Help in the Data Format and Organization section. 

Regards,
Micaela N
National Instruments
0 Kudos
Message 4 of 4
(2,950 Views)