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.
Solved! Go to Solution.
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:
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:
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.