05-14-2014 03:57 PM
Hey all-
I am completely new to LabView, and I've been struggling to teach myself though it to get the results I'm looking for recorded. I'm hoping someone could take a few minutes and lend me a helping hand.
I need (what I'm assuming is) a very simple VI that will read and record pressures from my two pressure transducers on screen and save out to an excel file so I can work with the data. I have two Omega pressure transducers, one is a P209X (reads 0-30PSI) and the other is a P309X (reads 0-3000 PSI). Both have a 0-5V output.
I've set up a crude VI that I can read the voltage outputs from my two transducers, but I'm not sure how to get it converted to PSI. I'd prefer a numeric LCD type number display rather than a line graph for both pressures so i can set my pressures, and then cycle the system and record the data.
I'm using LabView 2013 with a USB-6216, and have the P309x on A0 and the P209X on A1.
I'm basically recording input pressure and output pressure on either side of a regulator.
I certainly appreciate any help.
Thanks!
Carey
05-15-2014 10:57 AM
anyone?
05-15-2014 11:23 AM
05-15-2014 11:54 AM
Use scales in NI MAX to get your output from the task (Your task should be set up in MAX) to display the units that you want. ie, 0-5 vdc on 0-30 psi gauge, scale slope would be 6. You can create a more customized scale if you need to account for any linearity issues with the transducer. The Omega's are ususally pretty decent.
05-19-2014 04:27 PM - edited 05-19-2014 04:27 PM
Hi Jim/Doug-
Thanks for the help. I'm trying to incorporate your Vi but am having troubles. As I mentioned, I'm very new to LV, and can't stumble my way around. Can you modify the VI i've attached to get what I'm looking for? Then I can duplicate it for the other PDX. I can't seem to get mine set up like yours, and I'm spending useless hours trying to figure it out.
I've scaled my transducers in NI Max, though I don't know how to tie them into LV. What do I need to do? Sorry for the trouble.
Thanks for your help.
Best Regards,
Carey.
05-20-2014 06:55 AM
Your scales look fine. Your next step is to set up a task in MAX so that you don't have to set it up in the vi. See attached pdf for an example for a transducer. Notice I selected the appropriate scale. When you click to create a new task it will first ask for signal type and then channel. Signal should be voltage if you have a 0-5 or 0-10 vdc transducer. Then name it accordingly. Then edit the task to define the scale. The signal input range shouold match the units you scaled to (0-030, 0-3000, etc) You can set to continuous and run it in a loop but the more common method it to use N samples and then set the number of samples and a frequency.
The task in the example reads 100 samples at 1kHz so it reads those 100 samples in .1 seconds. That way you just read the data when required as opposed to it constantly polling the channel.
Then in your vi you simply drop in a MAX Daq read task , select a constant for the task name and the task(s) you created in max will be available. Alternatively, you could set a control and use some other condition to select the task
05-20-2014 04:47 PM
Thanks Doug- I think this has helped me make progress. You can see my VI attached. Do I have this setup correctly? I seem to be getting the results I'm looking for thus far (only have done the 0-30 transducer), however, the signal keeps dropping for extended times, and this seems to be random (see attached video). Any idea on what is causing this? I've read the voltage coming out the transducer and into the DAQ and it remains constant while the program shows this loss of signal.
Also, how do you write results to a csv or file that Excel can open?
Thanks again.
Carye
05-21-2014 08:58 AM
I've verified this "signal drop" is present with my other transducer as well. Seems to me that the board is doing something funny, or there is a setting I need to change. Any ideas?
Thanks
Carey
05-21-2014 09:47 AM
You set your task up to read continuous samples but at only 60 Hz. The loop will run much faster than that and you are only reading one sample per iteration. It will read through the group of 60 samples much faster than the rate they are collected. This is why it is better to use N-samples and set your number of samples and frequency to determine the update frequency of the task. Read the n-samples and average them and then update your display with that average but you need to put a delay in your loop or the daq will never keep up with it. There is no reason to update the visual output in the few milliseconds that the loop will run at unchecked.
There is a whole set of vi's for saving data to file. Look in the examples provided with LV and it will get you going very quickly.
05-21-2014 10:46 AM
Thanks Doug-
When I increase the sample rate and size, it is no longer a graphical line, but it measures zero then the pressure, and this repeats causing completely scewed info. See my image of running the program at 100 & 1000khz.
Any thoughts here? I really appreciate your help Doug.
Thanks
Carey