LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make labVIEW wait indefinately for a trigger w/o it continuously reading buffer

I am having trouble making labVIEW wait indefinately for a trigger. And once it aquires data it should get ready for the next aquisition. I have a NI-6023E board and am using labVIEW 7.0. I am attaching the VI I was working w/. While waiting for the trigger I dont want the VI to read the buffer continously.
0 Kudos
Message 1 of 5
(4,628 Views)
I think what you want to do is use the DAQ occurrence VI, and put it in before your AI Start, and make your AI Read wait for the occurrence.

Take a look at the examples/daq/anlogin/anlogin.llb/Cont Acq&Chart (Async Occurrence).vi. The only difference is that you have trigger conditions for your AI Start.

What this will do is trigger an occurrence when a certain amount of data is available in the buffer, and it won't be available until your trigger conditions are met. Therefore, you don't call the AI Read VI until the buffer has something in it, which is what you want.

Also, this AI Read will read again after the trigger occurs, so it will continue to read data until the acquisition is stopped.

Mark
Message 2 of 5
(4,628 Views)
Thanks a lot mark. But the graph continues to show zeros while waiting for the next trigger. I.e. Till the first trigger it waits, however after that the graph continues to display zeros. I need the VI to take n samples and then wait for the trigger for the next n samples. I changed the AI start to aquire N samples instead of 0(continuous acquisition) but the graph continues to show zeros in the time it waits for the next trigger. This also causes me to lose the old graph curve immediately after it is acquired.
(Sorry for being so late in thanking you but I thought NI would email me when my question was answered - it didn't)
I am attaching the modified VI just incase anyone wants to look at it.
0 Kudos
Message 3 of 5
(4,628 Views)
If you're needing to wait for a new trigger, then your while loop needs to change. Take a look at this VI.

Mark
0 Kudos
Message 4 of 5
(4,628 Views)
Awsome! This works out perfectly for me! There is one thing that I have been unable to do that is to stop this VI(using a STOP button) when it is waiting for a trigger. In the current VI AFTER pressing the STOP button I need to trigger it alteast one more time for it to stop.I was wondering if I would need to simulate a trigger(like use a software trigger) or something along with the STOP button.

Thanks a ton Mark, you've been most helpful.

I've made some minor changes to the VI so I am attaching it if it will help anyone solve the problem
0 Kudos
Message 5 of 5
(4,628 Views)