LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Continuously acquire, analyze, and plot data

Solved!
Go to solution

Hello all again,

I know that I have already gotten a lot of help on this program from some of you out there, and I hope that this is the final question I have. 

I would like to have this program plot the results on a waveform chart while the VI is running, rather than when it finishes.  I am sure that there is a simple way to do that, but I am now sure what it is.  I have also posted a link to the previous thread in case anyone is interested in what the VI is actually doing. 

 

Thanks!

 

http://forums.ni.com/ni/board/message?board.id=170&thread.id=362563&view=by_date_ascending&page=1

0 Kudos
Message 1 of 15
(3,979 Views)
Message Edited by for(imstuck) on 01-07-2009 01:45 PM
Message 2 of 15
(3,974 Views)

Thats the strange thing, the waveform plots are in the loop, I attached a jpg if that helps.

 

Thanks for the quick reply.

 

0 Kudos
Message 3 of 15
(3,967 Views)
Well I edited my post thinking what I said wouldnt help so i just edited what I had and deleted it as I have yet to find delete on these forms haha. Anyways, I don't have familiarity with the DAQ stuff so I know there are better people on here to help. But do you need more of the aquisition stuff in a loop or does it continuously take data on its own? Can you take the data put it in an array in a loop with shift registers. Then send that array to a cluster/waveform?
Message 4 of 15
(3,963 Views)

There is a fundamental flaw with the program that should be fixed before anything. You have a true constant in the while loop ORed with the error out. That means that the loop only executes once. The only way you can get multiple samples is by using the Run Continuous button and that should NOT be used to run your program. Replace the constant with a front panel Stop button.

 

It's also silly to use four separate DAQmx Create Channel functions when all that you are changing is the channel. Use one and specify a channel list of 'Dev2/ai0:3'.

Message 5 of 15
(3,955 Views)

Thanks Dennis, I am still learning as I go

 

I changed to a front panel control and changed the create channels, but it still does not do what I want it to.  I am trying to get it to display the results of a some simple calculations as the VI runs.  Also, because it is running a finite number of samples, is it possible to stop the loop in some way other than a front panel control and simply finish when the last ai sample has been collected?

 

Thanks again

0 Kudos
Message 6 of 15
(3,948 Views)
Use a for loop if there is the same number of samples every time? I don't know what it does once it is done collecting data but there is probably something it returns to show its done. You could just use an equal block and wire it to the stop of the while loop. When DAQ returns a value showing its done it it will stop the while loop.
Message Edited by for(imstuck) on 01-07-2009 02:46 PM
Message 7 of 15
(3,938 Views)
Instead of just wiring the error cluster out of the loop, try replacing it with a shift register. I had to make some modifications since the scaling files were missing and I don't have the exact same configuration but when I made the changes, there was an error being generated but not passed out of your loop. See if you get an error and try changing from finite samples to continuous samples.
Message 8 of 15
(3,914 Views)

Dennis

 

I don't seem to be getting any errors from that, even when I highlight the execution it shows as ok throughout the whole VI, whether it is on finite or continuous samples in the clock.  I have attached a zip file with all of the subVI's in it, I may have missed one in my previous attachment.  Thanks for the suggestion to put in the shift register, thats a good idea, Again, I don't have any trouble getting the VI to work, I am just wondering if it is possible to display the results while data is still being acquired.

 

Thanks

Chris

0 Kudos
Message 9 of 15
(3,911 Views)
Well, when I ran the modified program with my 6221, I had no problems getting it to display. Are you aware of the chart history? A chart will only display x number of values. That is the chart history length. When the number of values passed to the chart exceeds this amount, the old data is dropped. The default chart history is 1024. Maybe this is what you are seeing. Increas the history length by right clicking on the chart and selecting 'Chart History Length'.
Message 10 of 15
(3,884 Views)