LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stopping a DAQ after it's written a command via labview

Hi all,

I can't abort my program until the command that's been sent to my DAQ (before hitting the abort button) has completed.  For example:   I send information to my DAQ to cycle a digital wave a hundred times.  Then it starts cycling, but midway I want to abort.  So I hit the abort button/Control Task Abort, but I have to wait till all 100 cycles are finished before the program ends.

I don't want to make a producer consumer cycle, because I want my data digital, as opposed to it dependent on loop times. 

Any help on this matter would be much appreciated.

Thanks!
0 Kudos
Message 1 of 2
(2,591 Views)
Hello kima111,

If I am understanding what you are trying to do, you are doing a finite analog voltage generation of a square wave and output the wave 100 times.  Then you want to be able to stop the generation on command (before the 100 cycles completes).  I was able to accomplish this by slightly modifying the Gen Mult Volt Upatates-Int Clk.vi example program like this:



I changed the sample clock timing and then changed the way the vi checks when the vi is done (I use the Is Task Done.vi and a loop).  This way, when you press the abort generation button, the task clears and the generation stops immediately.

If you are doing digital generation, the example titled Write Dig Chan-Ext Clk.vi does something similar.

Just as a note, you should avoid using the actual abort button (or vi).  I am not sure if you are, but using this stops everything and does not release resources.  This can cause strange behavior and some other issues.

I hope this helps.  If this is not what you are trying to do, I would appreciate some more information about what exactly you are trying to do an how you are trying to accomplish it.


Message Edited by Neal M on 02-01-2008 01:23 PM
Neal M.
Applications Engineering       National Instruments        www.ni.com/support
0 Kudos
Message 2 of 2
(2,570 Views)