LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Retriggered acq with high trigger rate: stopping acquisition

Hi NI community:

 

My application requires digitally retriggered acquisition at a reasonably high trigger rate (> 30kHz) and sample rate (>= 500kHz) on a single analog input channel of an X-series PCIe DAQ card. My implementation is attached. I find that at some maximum trigger rate, the while loop takes too long to execute, and I run into a buffer error as expected.  This maximum trigger rate is reduced by any complexity I add to the contents of the while loop, so ideally I'd like nothing except the acquisition there.

 

The problem I'm having is how to stop the while loop at the appropriate time. I need to stop when I acquire a certain trigger, or after a certain amount of time has passed. Right now I'm using an elapsed time VI, but that slows down the loop by a factor of 2 or so. Is there a tricky way to halt the acquisition at a particular time without putting anything inside the while loop, either by using the "Time Elapsed" function, or with an external trigger? Maybe through the use of an event structure, or by dynamically changing the trigger source?

 

Alternatively, is there a more efficient way to implement the retriggering?

 

 

EDIT: Using tick counts instead of elapsed time speeds up the loop, but it would still be better if I could stop using an external trigger.

 

 

Application details:

I expect the triggers to come at uneven intervals within some tolerance, and I need to acquire several samples per trigger for SNR reasons. I don't know the number of triggers ahead of time, but I have a rough estimate of how long the acquisition should take. 

 

Best regards,

Brad

0 Kudos
Message 1 of 6
(2,938 Views)

Hello Braddeutsch,

 

Welcome to the forums! I would like to suggest that you take a look at this article below. If you still have any questions on retriggering please post back and let us what we can help with!

 

https://www.ni.com/en/support/documentation/supplemental/21/retriggerable-tasks-in-ni-daqmx.html

 

regards

0 Kudos
Message 2 of 6
(2,880 Views)

Thanks. That post links to the shipping examples, on which my current implementation is based. It's not clear from that information how to efficiently stop the while loop.

 

Regards

0 Kudos
Message 3 of 6
(2,844 Views)

Are you just trying to figure out how to get out of the loop after either a set amount of time or stop it with a control such as a stop button?

0 Kudos
Message 4 of 6
(2,831 Views)

Ideally, I'd like to stop the loop when I receive a digital trigger, but I would settle for a fixed amount of time.

0 Kudos
Message 5 of 6
(2,826 Views)

Let me know if this sounds like what you are looking for.

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019MiHSAU&l=en-US

0 Kudos
Message 6 of 6
(2,799 Views)