LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Canceling a data acquisition

Hello All,
I am starting data acquisition by reading the counter input and the start of the data acquisition is signalled by pressing a foot-pedal. Following the press on the foot-pedal, let's say that data is acquired from the counter source for 60 seconds. How do i incorporate a cancel button in the while loop (the data acquisition is done in the while loop) and ignore that data value and start again.
The process is further complicated by using the same foot-pedal for two different events so I have to differenciate between the first click and the second click on the foot-pedal.
The next question is how does one access a particular cell in a table? For instance if the user enters the row and column, I would like to access that particular cell.
The vi I started working with is attached with this message. Thanks.
KB
0 Kudos
Message 1 of 4
(2,855 Views)
Hello,

It sounds like you have two types of tasks going on, Counter Input and Analog Input. Since you are using a trigger from a pedal to start the acquisition, I would think that you're not just doing counter input because you can't actually trigger to start a counter task (unless you are using the signal as the gate - let me know if this is the case).

You will want to set you're counter to continuous edge count and if you are in fact using analog input, I would use AI digital start trigger with reference trigger. The first trigger would tell the acquisition to start, and then the data would be acquired, but not transferred to the PC buffer until it receives the second trigger (reference trigger). This might not be exactly what you want since it sounds like you would want to be acquiring data the entire time between the two triggers. This example program will demonstrate how to program such that you have Continuous AI with both Start and Reference Triggers.

One problem that you may run into is that you will have to do some software programming to stop the continuous counter input task. Or maybe I'm misunderstanding and you don't really want a hardware stop trigger at all. If this is the case then all you would need to do is wire some type of logic to the conditional stop terminal in the while loop that stops upon some user interaction.

In regards to obtaining particular values out of an array - use the Index Array.vi in the Array palette. The context help will shine some helpful information on that VI.

Best Regards,

Jared A
0 Kudos
Message 2 of 4
(2,823 Views)
Jared,
Thanks for the message. Maybe I did not make the point clear but the start of the data acquisition is trigged by a digital input. (foot-pedal shorts digital input, software recogonises the digital input, starts a loop for data acquisition from the counter for 1 minute). So the point was how you would cancell a timed loop.
KB
0 Kudos
Message 3 of 4
(2,819 Views)
Hi,

I did not see a timed loop in your application, however, I assume you are referring to a while loop with a particular wait. Lets assume you have LV6.1 or later. If so, I would use the event structure instead of the wait function. If you have LV7.0 or later, the dynamic event structure would be the way to go. With the dynamic event structure you can break out of your "wait mode" based upon a condition.

I hope this helps, and have a Great Day!

George
0 Kudos
Message 4 of 4
(2,796 Views)