12-27-2011 12:07 AM
Hello,
My question is two fold as I am still pretty unfamiliar with the variety of ways to acquire signals and condition them. My first question is if there is anyone who can provide me with any information on how to best condition acquired signals. The wires connecting my pressure transducers to the AD converter are not shielded and I am concerned about electrical interference from the surroundings and how to best minimize or filter the signals.
Secondly, I am writing a program so that I can acquire data continuously so that it can be displayed on the front panel for continual observation during a test (there is no need to save the data that is continuously acquired). The user then needs to be able to click a button from the front VI that will then acquire the most recent 5,000 samples from the sensors and then stop acquiring and pass the acquired data along to the rest of the program.
I have everything programmed except for this last bit of conditioning and aquiring the data in the above fashion. I do not know if there is a proper way to do this. It has been suggested that DAQ.mx is helpful in this situation but I am very used to the DAQ Assistant.
I have attached my VI as well as I am using LabVIEW 9.0
Any help or advice would be greatly appreciated!
Thank You,
Ellen
12-28-2011 11:28 AM
Hi Ellen,
Thanks for the detailed description and for posting your code. To begin, we have a great tutorial on how to properly ground and address noise in your circuit when acquiring data here in our Developer Zone: http://zone.ni.com/devzone/cda/tut/p/id/3344
In addition, DAQmx is definitely the way to go when programming for data acquisition. For example, looking at your code, you can greatly simplify your DAQ Assistant calls by crating tasks which sample multiple channels.
Coming from DAQ Assistant, here is a great tutorial on how to convert from DAQ Assistant to DAQmx http://zone.ni.com/devzone/cda/tut/p/id/2835. It basically explains how 10 functions can handle almost all of your data acquisition applications.
Let me know your progress or if you have any questions!
01-02-2012 05:07 PM
Hello Aldo,
I have been reading through the DAQmx guide and still struggling as to how to implement it into my code.
Several more questions have cropped up as I was going through this. First, it is unclear to me if I need a separate DAQmx for each of my four instruments or if I can aquire data from all four instruments through a single DAQmx. Second, I need to be able to apply a calibration in order to change the voltage signals into a pressure etc using a table of values so I am wondering if this can be accomplished through a DAQmx or if I needed to use a mapping function. Third, since I need to be continuously acquiring data as well as have the ability to acquire the most recent 5000 samples at the user's command, how can I accomplish this using a state machine. For example in my code, if I were to place the DAQmx inside the state machine and had it acquire data continuously from the sensors and then when the user changes the state to take a data point (take 5000 samples, average them and run them through my mathscript) will the DAQmx also continue to acquire data continuously so that the front display is always reading out information the user needs to see? I am under the impression that as you switch between states only the functions with the activated state are completed. If this is true, is it possible to acquire my data outside of the state machine and feed in the data to the state machine when the user calls for it?
Thank You,
Ellen
01-03-2012 01:07 PM
Hi Ellen,
1) It is good practice to set up a single DAQmx task to sample multiple channels from multiple instruments. Just be careful not to concurrently run two or more analog input/output DAQmx tasks due to them accessing the same resources. (http://digital.ni.com/public.nsf/allkb/485201B647950BF886257537006CEB89#case6)
2) There is an excellent template in LabVIEW which performs continuous acquisition of pressure with calibration found in the NI Example Finder. You can open up LabVIEW with a blank vi, go to Help > Find Examples > Hardware Input and Output > DAQmx > Analog Measurements > Pressure > double-click on Cont Acq Pressure Bridge Samples (with Calibration).vi. This vi will not be exactly to your application but you can tweak it to fit yours without re-inventing the wheel.
3) It sounds that you may be able to benefit from the use of both state-machine programming and event-driven programming. With an event, you can have LabVIEW sample 5000 samples whenever the user provides some sort of input. Here is a good tutorial on how to get started with events in LabVIEW (http://zone.ni.com/devzone/cda/tut/p/id/3331). In addition, here is a getting-started guide in our DevZone which explains state-machines in LabVIEW (http://zone.ni.com/devzone/cda/tut/p/id/3024).
Hope this helps!