Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Read - Values Scaled or Unscaled? Conversion to Binary

Solved!
Go to solution

Hey Everyone, 

 

I had a question regarding the scaling and output of DAQs. I am using LabVIEW 2009 SP1, with a DAQmx 9.0.2 driver and an X-Series card. I am trying to read data out from my DAQ and store it into a binary file.

 

How does the DAQ read samples, in a general scope? i.e. If I select NSamp NChan Analog 2D I16 on my DAQmx Read, what sort of values can I be expecting If I were to probe the data output? (Assume that I am making readings in the mV values and my overall range is 5 to -5 V. When it writes into the binary file then, what happens, what can I expect to see in terms of values - or maybe just descriptively?

 

Overall, a small overview would be very helpful. I have been trying to to troubleshoot skewed readings that I have been getting, so this will help me out immensely.

 

Thank you.

0 Kudos
Message 1 of 2
(3,186 Views)
Solution
Accepted by topic author matt87

Hi Matt87,

 

Reading data as I16 will return the unscaled, uncalibrated result of the 16-bit ADC.

 

If you want to write your own binary files, you'll want to include the device scaling coefficients--for X Series this is a 3rd order polynomial.

 

Here are a pair of examples that show how to write to a binary file and read the data back.  In this example scaling coefficients are stored in the header of the file:

    Continuous Acquire and Graph Voltage to File (Binary)

    Graph Acquired Binary Data

 

 

Having said this, I would recommend that you look into the integrated TDMS logging feature that was introduced in DAQmx 9.0.  The result is a binary .tdms file which is of a standard format that can be opened in LabVIEW or in several other programs with the correct plugin.  See the following examples for how to use the feature:

    Continuously Read Data and Log to TDMS File

    Continuously Log Data to a TDMS File

 

The second example does not require you to read the data into LabVIEW memory and will utilize minimal CPU.  The first example lets you see the data as it is being acquired.

 

 

Best Regards,  

John Passiak
Message 2 of 2
(3,163 Views)