Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

How to get raw ADC values from DAQ board?

I am using two NI PCI-6254 DAQ boards with LabVIEW and NI-DAQmx in a data-logging application that reads 64 analog input channels and writes them to files on my hard drive.  I have noticed that the data type of the output of the Analog Sample NChan NSamp VI is an 8-byte floating point (DBL) type.  I understand this to result from the VI converting the raw ADC counts produced by the ADCs on the DAQ board into real numbers that fit the input range I had earlier specified.  I would really rather LabVIEW skip the conversion step and just give me the raw ADC counts.  That way, the processor has less work to do and I can store only 2 bytes per sample rather than 8 bytes per sample.  (I will be generating a ton of data in my application and would like to keep log files as small as possible.)  Is there an easy way to turn off the automatic scaling feature in LabVIEW and have the Analog Sample VI just give me data of a 16-bit unsigned integer (INT16) tpye?
And on a related note, I am a little confused on what LabVIEW exactly does when it scales the ADC values into a real number range with units of volts.  Earlier today, I generated a 20Hz sine wave with amplitude 1.4V on Dev1/ai0 and tried to record 5 seconds worth of measurements of it.  I set the input high and low levels to +2V and -2V in LabVIEW using one of the NI-DAQmx VI's and recorded the DBL values that were generated.  When I read my data samples, each they read like:
0 Kudos
Message 1 of 2

Yes, you can turn off scaling in DAQmx by choosing a different type of Read VI.  Click on the poly-VI selector under the VI and you can choose a different variant.  For I16 or I32 data you can choose one of the Unscaled (Binary) variants.
Keep in mind that not only will the values be unscaled, the calibration coefficients will not be applied either.  This will affect your accuracy.  However, you  can query the scaling coefficients for each channel (including calibration) using the Channel property node.  Once you have the coefficients, store these away someplace and you can apply them later when you need to analyze the data.
Hope this helps
0 Kudos
Message 2 of 2