Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Retriggerable Analog Input using Analog Trigger on M Series

Hey Dave,

 

Good job troubleshooting that issue. When you say "falling out of sync" do you mean that the analog input is falling out of sync with the pulse train? Or that the pulse train is falling out of sync with the incoming TTL trigger from the laser?

 

What frequency is the pulse train set to? You said that you are outputting that pulse train to the oscilloscope as well (on PFI 12)? If so, can you verify that the pulse is in fact going at the expected frequency? Have you tried increasing the frequency of your pulse train slightly to adjust for this apparent lag?

 

How I understand it is that you are starting analog acquisition when the trigger hits, and then sampling at a rate set up by the counter output...is this correct? Or are you sampling at the same rate as your TTL signal? Either way, try to measure your clock signal (PFI 12) and make sure you are getting the correct frequency. If there is a lag, possibly try to increase that frequency to compensate.

 

-Nathan H 

Software Developer
National Instruments
0 Kudos
Message 11 of 17
(1,121 Views)

Nathan,

 

What you requested is pretty much what I did right after I got in this morning.  Here's what I found out:

 

When samples per trigger is set to >1, the pulses on the train are separated by the frequency (250kHz, 500kHz, doesn't matter).  Also, the first pulse train is about 150ns after my TTL trigger (guessing that's DAQ response time).

 

What's not making senes is when I do only 1 sample per trigger--which is what we want since we just want to sample the laser pulse's peak.  The first sample records somewhere near that 150ns lag time since it samples the laser pulse.  However, the next sample pulses start 2x the frequency from that point.  So at 250kHz, it's 500kHz or 2us past where it should be.  Or more visually, at 1 sample/trigger the pulse starts where the first pulse ends with >1 samples/trigger.  Except for the first trigger/sample that I described earlier.

 

Also, you've been a great help in pointing me in the right direction.  Not only am I solving this problem, I'm learning tons about data acquisition that will certainly help me in my studies.

 

-Dave

0 Kudos
Message 12 of 17
(1,119 Views)

Hey Dave,

 

From what I understand, this should actually be the expected behavior. When you take multiple samples per trigger, your samples should be separated by the 1/Fs where Fs is the rate of your pulse (and also the sampling rate since you are using your pulse train as the sample clock). However, if you only take one sample, then it doesn't matter what your sampling frequency is, it just matters what your trigger frequency is. So you should see this 1 sample whenever your trigger hits.

 

For example: say your pulse train (sample clock) is generating at 250KHz (4us period), and your trigger is coming it at 1KHz (1ms period). IF you have >1 samples, (lets say 10 samples per trigger), then every time the trigger hits (every 1ms) you will get 10 samples, all separated by 4us. However, if you have 1 sample, then you will just get 1 sample whenever your trigger hits (every 1ms). Is this what you meant by:  at 1 sample/trigger the pulse starts where the first pulse ends with >1 samples/trigger? If not, please clarify and let me know the frequency that your trigger is coming in at (I thought it was 1kHz). 

 

-Nathan H

Software Developer
National Instruments
0 Kudos
Message 13 of 17
(1,107 Views)

Nathan,

 

I was able to get the timing down, record the pulse, and the data seems to follow the laser's pulse width and wavelength.

 

However, our next goal is to bring in a second MCT detector.  The way the optics work is the two pulses combine and half of the intensity goes one way and the other half goes orthogonal.  So collecting both essentially doubles the signal.

 

Can I set up the DAQ to sample both channels simultaneously sample the MCTs?  For example, can it just take the two samples and then do the ADC or does it have to take one, ADC, take the 2nd?  If not, how would I calculate the delay between the two?  If the delay's on the order of a nanosecond, I might just be able to change the path length to one of the MCTs so they sample at the proper times.. 

 

So far, I've tried creating a longer pulse train (20 samples per trigger at 250kHz) and scanned through to see if one of the sample ticks (on the train) caught the 2nd MCT's pulse but that didn't work.  It always samples the first one properly but not the 2nd.

 

Thanks!

 

-Dave

0 Kudos
Message 14 of 17
(1,093 Views)

Hey Dave,

 

The USB-6251 does not do simultaneous sampling. Whenever the sample clock starts (the sample clock being your retriggerable counter), it will take the first sample, then measure the 2nd sample. For this card your aggregate sampling rate is 1.00 MS/s, so if you have 2 channels, then your max sampling rate is 500KS/s. The delay between each sample is 1us according to the 6251 specs: http://www.ni.com/pdf/manuals/371291h.pdf. (it's the settling time for multichannel measurements on page 2).

 

Where are you sending the 2nd signal into? are you using another analog input channel? If so, you can go to "browse" when selecting your physical channels, and then use shift or ctrl to select multiple samples (shift for selecting channels that are in a row, ctrl for selecting multiple random channels). Make sure when you are reading back your input you select Multiple Channel, Multiple Sample. 

 

Channel 0 and Channel 1 selected:

 

multiple channels1.JPG

 

Channel 5 and Channel 1 selected:

multiple channels2.JPG

 

I hope this helps!

 

-Nathan H

 

Software Developer
National Instruments
0 Kudos
Message 15 of 17
(1,083 Views)

The 2nd signal comes from an idential MCT detector and is connected into another AI input channel via a same-length BNC cable. 

 

Thanks for the tip of AI input tasks.  I've been just been stringing tasks together which is probably inefficient and doesn't look as nice on the block diagram.

 

1us difference is definitely too much--roughly 300m difference at c.  Are there any thing that I can do with the DAQ or do I need to rethink my detector strategy?

 

Thanks,

 

-Dave

0 Kudos
Message 16 of 17
(1,076 Views)

Hey Dave,

 

Unfortunately, for our multiplexed cards, this 1us is fairly constant. If you truly want simultaneous sampling, you would need to look at our simultaneous sampling cards (these are higher end cards and tend to be more expensive). If you would like to stick with USB, here are some options:

http://sine.ni.com/nips/cds/view/p/lang/en/nid/209077

http://sine.ni.com/nips/cds/view/p/lang/en/nid/209078

 

If you want to switch to a PCI card, you can get simultaneous sampling for a little bit cheaper:

http://sine.ni.com/nips/cds/view/p/lang/en/nid/209219

 

The other thing you could try is to just get another board comparable to the one you currently have. Then use two boards to acquire samples and synchronize them by using the same clock. Basically this entails generating a digital pulse on one the cards (at 250KHz if you want 250KS/s). Then using this digital pulse train as the timebase for the card that it's being generated on, and also wiring the output of this pulse train to the other card. Then use this input pulse train as the analog input timebase for the 2nd card. This makes it so that both card's analog inputs are using the same sample clock as their timebase.

 

Software Developer
National Instruments
0 Kudos
Message 17 of 17
(1,065 Views)