08-23-2006 11:52 AM
Hi all,
Also poted this on the labview board, but maybe this one is better for this question.
I'm running Labview 8.0, and have a PCI-5124 and PCI-6040E to use. My
application is to trigger on 2 pulses (trigger#1 and trigger#2) with the
PCI-5124 (pulses are about 200ns width, the 6040E does not trigger reliably on
them) that will come at random times, but within about 500us of each other.
Then, the time between the incoming trigger pulses must be measured to within
about 1us. I will be triggering a laser to fire with a digital pulse output
(presumably from the 6040) sometime after the trigger#2, based on this time
that was calculated. Basically the flow goes as follows:
1) recieve trigger#1 (on PCI-5124)
2) receive trigger#2 (on PCI-5124) around 500us later.
3) calculate time between trigger#1 and trigger#2, and use this to calculate a
delay time (DELAY)
4) Put out a digital pulse at time DELAY after trigger #2; DELAY will be about
1.5-3ms, must be accurate to within +/- a microsecond or so.
So far my main trouble is getting everything synchronized - the triggers come,
and I get them by using Ni-scope functions to collect two very short samples (1
point). Then, I fetch the two 1pt waveforms and use the waveform output of
absolute timestamps to calculate DELAY. I have a task where the 6040E count
edges of a 1MHz square wave as a "clock", and try to output a digital
pulse on the 6040 when the clock reaches the value of (trigger#2 time + DELAY).
Some big problems are, the way I check the "clock", the pulse
out has a jitter with respect to trigger #2 of +/-50us, which is way too much.
The fetch function itself also seems to take about 0.8ms even if I only fetch 1
point.
So I guess my most pressing questions are:
1) what should I use as a "master clock" for this application?
2) How do I make sure that once I calculate the appropriate time to put out the
digital pulse (DELAY+Trigger time#2), a digital output comes at exactly this
time (+/- 1us)?
3) Is there a faster way to calculate the time between the 2 trigger pulses
than my "fetch and check timestamp"?
Help with any of these questions would be greatly appreciated; I'm new to
Labview and I've been spending a lot of time trying to figure out how to solve
this problem which sounded fairly simple in words. Attached is my latest crack
at it, but I would rather start again with a more efficient way overall instead
of forcing this to work if that's easier. Thanks for taking a look at this!