06-01-2009 08:24 PM
Background info:
I am collecting voltage data through a NI USB-6008/9 AD card, namely for a four-wire strain gage (readings on the order of 20mA max). Currently I am trying to learn how to use the card by reading voltages from a power supply. However, I discovered that the signal obtained is a bit noisy, fluctuating +-10mA from the "correct" value. After running the signal through a low-pass filter, I was able to obtain something cleaner (+-1mA fluctuations). I am now trying to perform a moving time-average to try to refine the data further.
Questions:
Firstly, with the equipment I have, is obtaining a signal that is stable to within maybe a few hundredths of a mA realistic? I am somewhat new to data acquisition. My application requires more precision than accuracy.
Secondly, I've been working on a program to obtain a continuous time average. My hope is to write a program that takes the previous n data points and averages them. I have very little experience with LabVIEW, and I've been having some difficulty. Attached is what I have so far... it seems to spit out the very first data point and then remains constant. I think it should be something very simple, but I cannot seem to figure out what I'm doing wrong. (I am considering just dumping the data onto a text file and manipulating it in MATLAB instead, but I would like to give LabVIEW a try first.)
Finally, is obtaining readings from resistance thermometers realistic with this device? I realize that I would need to provide a constant current source, but assuming I am successful, could I expect decent temperature readings?
Thank you in advance!
06-01-2009 08:54 PM
There is a reason your VI spits out the first data point then remains constant. If you run the VI, you only acquire a single data point. You don't have have a while loop around the DAQmx read function to read a single point more than 1 time.
The second half of the problem is that you have a while loop around your write to measurement file. You only want this to occur a single time. That while loop will either run once (if the boolean is false) or run forever constantly appending the same data point to the same file (if the boolean is true). Since the boolean is outside of the loop, the only way to stop the VI is to hit the abort button.
I would recommend you look at examples of data acquisition and File I/O from the example finder. I would recommend take some LabVIEW tutorials found here. How to Learn LV.
In general, you want to set up your acquistion and open up your data file before a while loop , do the acquisition in the while loop where you can send data to the file. End the acquistion and close the file after the while loop. Depending on your timing (how many data points per second, how often you want to write to a file) you may need a more sophisticated program architecture.
06-01-2009 08:56 PM
06-03-2009 10:06 AM
I'm sorry; I uploaded the wrong file. Would you be so kind enough to look at it again and help me figure out what is wrong?
Incidentally, the one I uploaded before does in fact work, but it does not incorporate any time averaging.
Thank you in advance!
06-03-2009 10:18 AM
Your VI still only acquires 1 sample, just like your original one did. So I wouldn't necessarily call that "working".
You need to put your DAQmx Read inside the loop.
06-03-2009 10:33 AM