From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to do multi-buffered acquisition on NI-6115

I need to acquire multiple sequential arrays of data over a single channel using an external clock and a digital trigger (~1000 arrays total, 1000 samples/trigger, external clock frequency 500kHz, trigger frequency 250Hz). It is important that the sampling start right after every trigger, and that I do not miss any triggers. I can already do this using simple buffered acquisition with the ai start and ai read vis in a loop, except it misses triggers while the loop re-starts. Is there any way I can define a buffer large enough to hold all of the samples I need, then to have it read only the number of samples I want after each trigger into this large buffer? I don't need to see the data until the whole acquisition (1000 x 10
00 samples/trigger) is over. Is this what multi-buffered acquisition does? I cannot find any literature on the NI site related to multi-buffered acquisition. Thanks for any help.
0 Kudos
Message 1 of 3
(2,418 Views)
One solution may be to do an analog input of both the trigger signal and the signal you want to measure. Then in software you could parse out the 1000 points after each time the trigger signal goes high.

What does your code look like?

I have attatched an example (untested) that is what I believe your current program looks like.
0 Kudos
Message 2 of 3
(2,418 Views)
So every 4 msec you get a trigger signal that should initiate a 2 msec acquisition (1000 samples at 500 kHz sampling rate)?

There's an example of a way to use your board's counters to support retriggered analog acquisition here on the NI site: Retriggered Analog Input Example. The code may look a little complicated, but the basic idea is described pretty well.

The goal is to make sure the timing is handled in hardware so you don't miss triggers while doing the software reprogramming. AI Start would be called only one time prior to your loop, and only AI Read would be calle
d inside the loop.

Just be careful about your timestamp info. The analog acq. task won't have any "awareness" of time intervals between samples. It'll be up to you to slice up the data into appropriate chunks. You can probably do this by simply requesting the right number (1000) from AI Read.

Good luck,

-Kevin P.
CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 3 of 3
(2,418 Views)