09-21-2011 04:29 PM
What should my algorithm be to do the following?
Without any user interaction, the program should wait for a trigger, save the read analog signal to disk, and retrigger.
Current algorithm:
However with this algorithm, there is no way to gracefully exit the program.
Suggestions? (Any language acceptable for code sample responses)
09-22-2011 12:53 PM
Hi Steven,
The key here is to make your task retriggerable. That way, you only need to start and clear the task once, so you can quit the task easily with a stop button in your while loop. There is a VI example that ships with LabView which should get you started here. To find it, open the Example Finder (Help>>Find Examples) and then once you have it open, navigate to the search tab and search "Retriggerable." An example should come up titled "Acq&Graph Voltage-Int Clk-Retriggerable.vi." If you look at the block diagram here, you can see that a property node is used to make the DAQmx task retriggerable, so that you can trigger your measurement repeatedly. Please post back if you have further questions.
Best,
Dan Nelson
Applications Engineer