LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Begin collecting data mid-run

Hello everyone. I'm new here and I have a quick question about collecting and processing data.

 

I am on LabView 2012 and I am using a DAQ to collect and process some data. There are two signals of dynamic data type ("Input" and "Output") that I am plotting along with their FFTs. This part works fine. However, the data collection period is very long (20-30minutes for this experiment) and an event of interest ("Flutter") happens around 25 minutes. What I would like to do is to wire my block diagram and add a boolian button to the front panel such that right before this event looks like it is about to happen, I can press the button and begin plotting and taking the FFT of that short data segment. The attachement shows what I am working with.

 

-Kyle

0 Kudos
Message 1 of 5
(2,665 Views)

Kyle,

 

Where is your loop? Any program which needs to repeat portions of the code should have those portions in a while loop. Do not use Run Continuously for opreating a program like this. 

 

If you are taking 30 minutes of data before the DAQ Assistant returns, you cannot conviently stop the program except with the Abort button which is also bad practice.

 

Both of those buttons are for use during program development only. It has been said that: Using the Abort button to stop a VI is like using a tree to stop a car. It works but there may be unintended cosnquences!

 

The Dynamic Data Type generated by Express VIs tends to hide the underlying data structure making it more difficult to manipulate the data. For data in waveforms or arrays you can use Get Waveform Subset.vi or Array Subset to get the portion of the data you want to look at closely. 

 

Lynn

0 Kudos
Message 2 of 5
(2,648 Views)
You should spend a bit of time going through the online tutorials. As Lynn pointed out, you need a loop -- and an event structure would likely help too. With an event structure you could easily write a loop that does one thing, but when a button is pressed,it starts doing something different.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 5
(2,631 Views)

Thank you for your replies Lynn and Mike.

 

Lynn,

When I choose the properties of the DAQ Assistant, I choose the samping rate and the number of samples. At the end the code ends on its own. Is this as good as a while loop? If I want to end it early, what kind of code should I use? If there is a tutorial on this, that would be cool too. I've programmed something like this before (a while loop that I can trigger an exit condition cleanly)  but it didn't involve a DAQ and now it seems tricky.

 

I think I can do what I need with a case structure. However, the way the DAQ Assistant outputs data is mysterious to me in that even when I use a waveform graph to plot in real time, nothing shows up on my front screen until the end. This gives me the impression that the data is collected and then passed all at the end. Is this right? Mike, which videos do you think I could explore to learn about this?

Download All
0 Kudos
Message 4 of 5
(2,577 Views)

Here is a good example of what a while loop is - you would be able to stop it by attaching a button to the conditional terminal of the while loop.

http://www.ni.com/tutorial/7588/en/

 

If you would like the data to be plotted as data is available, it sounds like you need a waveform chart instead of a waveform graph. There's a good article talking about the difference between those in this article.

http://digital.ni.com/public.nsf/allkb/95FEE9F5B252507E862562BA00007657

0 Kudos
Message 5 of 5
(2,537 Views)