Discussion:
generating TTL pulse, acquiring a TTL pulse and measuring time difference
(too old to reply)
Aniket
2007-04-20 00:40:10 UTC
Permalink
Hi, I am using PCI 6259 and Labview 8. I would like to send out a TTL pulse, be
able to acquire it, acquire another digital (TTL) signal and then
measure the time difference between the two pulses. I have tried using
the measure time difference between two pulses vi, but since this
requires using both counters, I encoutner error with the resources
being reserved by one of the counters. Is there a way to get around
this problem?

Aniket
Kevin Price
2007-04-20 13:10:14 UTC
Permalink
I'm not near hardware to verify for sure, but I *think* the M-series boards' counters support a mode called something like "two edge separation" measurement.  This only requires 1 counter which detects both edges.
So, generate a pulse with ctr0.  Setup ctr1 to measure "two edge separation", using Ctr0 output as the earlier edge and your external response pulse as the later edge.
Another sneaky option would be to setup ctr1 for buffered period measurement.  Ctr0 output would act as an "Arm Start" trigger and your external response pulse would be the Sample Clock.  The 1st (and only? -- depends on your device) measured "period" would be the time from the trigger to the first response edge.
-Kevin P.
Aniket
2007-04-20 16:10:09 UTC
Permalink
Hi Kevin,

Thanks very much for the reply. I was actually using the two-edge separation routine. This is how I set things up:
1. ctr0 generates a TTL pulse. I route this to the Gate input of ctr1,
I have tried both software routing and hardware connection.
2. The second pulse, which is from a camera, arrives on the Aux input of ctr1.
However, when I run the vi, the I see an error like this:Specified route cannot be satisfied, because it requires resources that are currently in use by another route.The full message looks like this:Property: CI.CtrTimebaseActiveEdgeSource Device: Dev1Source Terminal: 80MHzTimebaseDestination Device: Dev1Destination Terminal: Ctr1SourceRequired Resources in Use bySource Device: Dev1Source Terminal: PFI12Destination Device: Dev1Destination Terminal: PFI4PFI12 being the output of ctr0 on this board and PFI4 is the gate input of ctr1. Then I tried routing the 20MHz timebase signal to the ctr1 source. But that did not work either. The same error resulted. In retrospect, it is the same issue. So, I am kind of stuck at that point. Let me look into your second idea. Aniket
Aniket
2007-04-24 01:10:09 UTC
Permalink
Abhinav, Thanks for your interest. Here are two vis I used:1.Generate_pulse_meas_separation_3: routes the output of ctr0 to the gate input of ctr1 through the route signal vi and then performs the measurement.2. gen_pulse_meas_separation: this performs the measurement while I hardware route the relevant signal.Aniket


Generate_pulse_meas_separation_3.vi:
http://forums.ni.com/attachments/ni/70/6761/1/Generate_pulse_meas_separation_3.vi


gen_pulse_meas_separation.vi:
http://forums.ni.com/attachments/ni/70/6761/2/gen_pulse_meas_separation.vi
Abhinav T
2007-04-24 22:40:08 UTC
Permalink
Aniket,
I played around with your VI and have attached a much cleaner version of your code. The only thing I had to do was connect another TTl signal to PFI9 and it measured the seperation between the channels.
 


gen_pulse_meas_separation MODIFIED.vi:
http://forums.ni.com/attachments/ni/70/6771/1/gen_pulse_meas_separation MODIFIED.vi
Loading...