Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6212 Retriggered acquisition architecture

Solved!
Go to solution
Highlighted

Dear community,

 

I have a USB-6212 board and a 200 kHz digital trigger signal from a laser. I am looking for a sequence that allows me to acquire four data points (analog voltage measurement from a photodiode at full sampling rate) after each trigger peak. Then, the card should wait until the next trigger peak and measure again four points. It should do this until a preset number of samples is acquired and then export them as an 1D-array without the need to permanently restart the measurement using a loop. It should be performed as much hardware-sided as possible to increase the effective rate of measurements.

 

I already read that the more expensive X series cards can perform retriggering relatively easy but I didn't figured a structure for my purpose. It would be very great if you could help me.

Thank you very much!

FinalDestillation

0 Kudos
Message 1 of 4
(395 Views)
Highlighted

There's a workaround for your device that involves using its 2 counters to generate a hardware-retriggerable finite pulse train which the AO task can use as its sample clock.  A high-level diagram  of the idea can be found in item 3 over here.   A simple working example can be found over here.   (For that matter, just within the past few days I posted some partly-related code over here, though the other example will be a more fully relevant starting point for you).

 

 

-Kevin P

Message 2 of 4
(337 Views)
Highlighted

Thank you, Kevin!

 

Your message was very helpful and I could implement the structure into my current measurement application. What is still unclear to me is how I can preset the number of the samples, that are acquired in total before the measurement stops. As far as I understood, the variable "samples per trigger" defines the number of samples that are acquired after a single external trigger signal is detected. But where do I select the number of samples that should be acquired in total?

 

Thank you very much and best regards

0 Kudos
Message 3 of 4
(324 Views)
Highlighted
Solution
Accepted by topic author FinalDestillation

Probably the simplest way to pre-determine the total # samples to accumulate is to configure the AI task for Finite Sampling.   If you wanted to collect 4 samples per 200 kHz trigger for 2 seconds, you'd configure DAQmx Timing for 4*200k*2 = 1.6 million samples.

 

You could start your tasks, call DAQmx Read with the same request for 1.6 million samples, and 2 seconds later it would return them to you. Because it's a Finite Sampling task, it would stop sampling on its own after acquiring the 1.6 million samples.

 

Really, you could also do pretty much the same thing using Continuous Sampling.  You'd just have to manually stop the task yourself after reading the samples.  However, at relatively high rates like yours, Continuous Sampling leaves open the potential for DAQmx to throw a buffer overflow error.  It would be functionally irrelevant, but liable to be confusing or at least annoying.  Best to avoid it with Finite Sampling.

 

Meanwhile, there's another way you could approach this task without need for the counters.  Briefly: configure the 200 kHz signal to act as an external sample clock.  Then construct a task where the channel list consists of the same one channel listed 4 times.  You may also want/need to explicitly set the "convert clock" rate with a DAQmx Timing property node.  (This is the clock that controls the multiplexer as the board selects each channel in the task in sequence.  You'd be tricking it by selecting the same channel 4 times in a row, but the clocks don't know the difference.)

 

 

-Kevin P

Message 4 of 4
(320 Views)