07-06-2011 12:38 PM
Excellent suggestions! It increased the processing speed of my program greatly. But the stop button still doesn't seem to work. The program flow seems to stop at the Read WDT and waits for the trigger. So once it gets the trigger, the program continues and go on to stop the program.
07-06-2011 12:53 PM
That is what is supposed to happen. There is absolutely nothing wrong with the stop button. You have a complete misunderstanding. You have programmed the scope to wait for a trigger and that is what your program is doing. Simply clicking on 'Stop' does not affect the scope at all and I don't understand why you think it should.
How long does it actually take to get a trigger? What have you set the timeout to? Have you tried calling the Abort function in a separate loop?
07-06-2011 12:57 PM
You mean like a loop within the actual loop?
07-06-2011 01:06 PM
No. Like in a loop that is outside your main loop. Dataflow would prevent a loop inside your main loop from being read. Use an event structure in this separate loop.
Your problem is aborting the fetch with an external trigger defined. Do a search for 'scope trigger abort' and see some of the solutions.
07-06-2011 03:25 PM
Like was stated before, what do you have set as the timeout of your niScope Read function (http://zone.ni.com/reference/en-XX/help/370592N-01/scopeviref/niscope_read__poly/)? What you have described so far is EXPECTED BEHAVIOR because of the way you have programmed things. If you don't want to wait on the trigger before being able to stop the program, you should set the timeout very small (probably .2 or less since it is defined in seconds) and then programmatically check for a timeout error right after that function executes. If you get a timeout error, programmatically clear it and continue executing until the user presses stop or some other condition causes it to quit.