05-20-2014 08:00 AM
Hi,
I have a data acquisition set up to acquire data for 100 ms (rate=10000 S/s, samples= 1000) when the PFI line on my DAQ device recieves a digital trigger. The entire code is in a while loop with a control wired to the stopping condition. The timeout on my DAQ assistant is set to -1, because I want the program to wait for the user to send the trigger signal. When I press the stop control on the front panel, the program doesn't end. I believe this is because the DAQ assistant is waiting to acquire data indefinitely because the time out is set to -1. I need the program to end when that stop control is pressed.
Any suggestions?
Thankyou
05-20-2014 08:24 AM
Show us your code.
05-20-2014 09:54 AM
And of course you started with a DAQ assistant. Go back and start with one of these http://www.ni.com/white-paper/14121/en/
Now you have a framework that does what you want and responds to the user.
05-20-2014 11:01 AM
This isn't the exact program, but its the same problem.
Also, I have a rising trigger to start acquisition.
05-20-2014 11:23 AM
Put in a timeout and see what happens. If you don't get your data, you just skip the checking of the data. Loop until you get your stop condition.
05-20-2014 11:41 AM
If I set a timeout and hit the stop control, the program waits for the timeout that I set and returns an error (200284).
05-20-2014 11:53 AM
@MTB77 wrote:
If I set a timeout and hit the stop control, the program waits for the timeout that I set and returns an error (200284).
Is this a problem for you, or just a comment?
05-20-2014 12:01 PM
A problem. When I press stop, I want the program to end immediately. Instead, it waits for the timeout then displays an error message. How do I get it to end as soon as I press stop?
05-20-2014 12:26 PM
Then you need a more suiable archetecture. Start from a Finite measurment project template. Call DAQmx Control Task with Abort as the input to end your task immediatly. The DAQ assistant is not going to work for you.