Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

synchronizing pulse signal(3kHz) and analog input

Hi there,
 
I  have a problem in programing the analog input data aqusition.
My DAQmx card is a USB-6251 and I am trying to collect data from the boxcar system. For the transient absorption measurement, I am using 3kHz ultrafast laser and detecting the data with photodiode and sent this signal to Boxcar. Then this signal from boxcar will be sent to the analog input of USB-6251. First problem is to trigger every pulse signal from the laser master clock(or the boxcar busy output). Since I am collecting data after every single pulse from laser master clock, I need to trigger the every pulse from laser and then aquire the data from the analog input. I found one example for this retriggerable measurements, and I attached the file below. But this example has a speed problem. It collected data only a couple of hundred data points per second. That means it is missing most of 3kHz pulse signals (because of start and stop of daq task in while loop).
Summary, I have to aquire data with 3kHz operation triggered by every single pulse(3kHz). After triggering, sample rate will be 1MHz and number of sample is 100 ( since it is operating at 3 kHz, I have to aquire less than 150 samples per one pulse). Then I get one data point with averaged 100 sample, and finally need to get 3000 data points/sec.
Is there any ways to solve this problem?

Message Edited by giggs on 08-31-2006 12:02 PM

Message Edited by giggs on 08-31-2006 12:03 PM

0 Kudos
Message 1 of 4
(3,758 Views)
Hi giggs,

Here is another example program which may be able to help you out.  This makes use of the 2 counters on your USB-6251 to generate a retriggerable pulse train which can then be used as the sample clock for analog input.  Let me know if this example runs fast enough on your system to keep up with the requirements of your application.

In regards to averaging each 100 data points, this will have to be done in software.  There is no hardware averaging available on the USB-6251.

Another thing to note is that you may find that the software delay associated with reading the data and averaging it 3000 times per second causes you to get a buffer overflow on your acquisition.  If this is the case, I would recommend reading more data each time and doing the averaging all at once.  For instance, acquiring 1 second worth of data and parsing it all at once to get your 3000 data points may be more efficient than 3000 sepearte acquisition/averaging operations.

Let me know if the example and recommendations in this post are able to help you out.  I want to make sure that you get you application up and running.

Have a great day!
Travis W

Message Edited by Travis W on 09-04-2006 10:21 PM

0 Kudos
Message 2 of 4
(3,705 Views)

Travis,

Thank you for your help.
But still the speed of collecting data is too slow. I tested the example(two counter) with USB-6251and function generator at 3kHz.
I connected the pulse signal(3kHz) from the function generator to counter
and digital trigger input(PFI0). For the clock source for AI input I used a Ctr0internalOutput. Then this system synchronized perfectly. But the iteration of while loop is too slow, it only collects less than 100 data points per sec. It means that it is missing most of the trigger signals.

Buy the way I am trying to use another method, called pause trigger. This is collecting data continously when trigger is high or low. If I can control the trigger pulse width, this may be better solution for my job. But my adviser want to incorporate this program to our main instrument interface program designed from LV, and he doesn't want to use while loop for sub instrument interface program. Is there any ways that I can execute pause trigger example without while loop?

(Basically, In order to use pause trigger example I need to buy delay generator. So If I can do the same job without using pause trigger example, that will be the best way for my job)

Message Edited by giggs on 09-05-2006 10:34 AM

0 Kudos
Message 3 of 4
(3,688 Views)
Hi giggs,

I ran the retriggerable example on my computer using a USB-6251 and with a couple small modifications, I was able to get it to retreive 100 points at a time (sampled at 1MHz and triggered by a 3kHz pulse) and average them without missing any pulses.  Try the attached example and see how it works for you.  If it doesn't, please let me know what kind of computer you are running this on, and the exact behavior you are seeing.

In this example, I've set the while loop to exit once it has been running for a certain number of seconds.  This makes it easy to look at the number of iterations of the while loop and the total number of points acquired.  If your trigger input is a 3kHz TTL square wave, you shuold get 300,000 total points for every second you run the loop.  If you want this loop to run continously, simply remove the check for time inside the loop.

As you mentioned, a pause trigger could work, but this seems like the best way to acheive your application.  Let me know if there are any considerations I've missed or if there is anything else I can help out with.

Have a great day!
Travis W
0 Kudos
Message 4 of 4
(3,662 Views)