LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Between Rising Edge on Multiple Channels

Basically, here's my issue:

 

I'm trying to get the time between two pairs of rising edges. I'm using a cDAQ 9171 with an NI 9402. Each input is connected to a velocity gate which outputs a TTL signal, and I'm trying to capture the time between a pair of inputs, such as the time between an input on line0 and the time between an input on line1. I'm trying to make the code so that it detects each input and gives a time between two pairs of edges; the caveat is that this is going to be used for calculating the velocity of a bullet, so it needs to be as fast and accurate as possible.

 

What I'd like the program to do is wait until the first rising edge triggers it, and get the number of samples up until that point. Then, once the second input triggers, get the number of samples up until the second input, and so on for the third and fourth inputs. From there, I know I'd need to subtract the sample values for each pair and divide by the 80 MHz clock. My problem is that this code doesn't trigger until it's already had one input, and the counter doesn't output each event after they happen. Ideally, the program should be continuous, so it can spit out the time, wait until the next shot, then spit out the next time, etc. 

 

Edit: attached a file saved for LabVIEW version 10.

Screen Velocity.PNG

Graph.PNG

I should also add that I'm fairly new to LabVIEW, so I'm not entirely sure how everything works yet.

Download All
0 Kudos
Message 1 of 5
(3,923 Views)

Here is a useful article that I found.  Please read and let me know if you have any further questions.

 

How Can I Measure the Time Between the Rising Edges of Two Digital Signals?

 

http://digital.ni.com/public.nsf/allkb/4F5002129C5E720D86256AC30079A391

-Joe
0 Kudos
Message 2 of 5
(3,880 Views)

Conceptually, this is exactly what I'm looking for. But how would I map the digital input lines to this? All I can access when I try to use a property node is the PFI lines and other onboard things, not anything from port0/lineX

0 Kudos
Message 3 of 5
(3,861 Views)

Please take a look at the following example.  When you open the program, there will be a tab to select 2 Edge Separation.  Select the input terminals you would like to measure edge separation between.  Let me know if this helps!

 

 

-Joe
0 Kudos
Message 4 of 5
(3,844 Views)

Joe,

 

Unfortunately, with my hardware it seems that I can't use the two-edge separation, hence the change detection setup that I have in my diagram.

0 Kudos
Message 5 of 5
(3,797 Views)