Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

measuring distance between 2 pulses (PCI-6221)

Solved!
Go to solution

Hi,

 

I have a digital signal that sends a pair of pulses (100ns width each) roughly every 100ms and I would like to measure the time between the two pulses of one pair (with a resolution of 100ns).
At the moment I got a PCI-6221 to realise this task. Unfortunately I found no solution up to now as all counter measurements I found measure the time between constant frequency signals, i.e. they can not measure the distance between 2 single pulses.

 

Any help / ideas / or even telling me that it's impossible to solve this task are appreciated

0 Kudos
Message 1 of 3
(5,956 Views)
Solution
Accepted by topic author Kvasir

Are the two pulses on the same line?  

 

If so, you'll just need to configure a period measurement task.  If they are on separate lines, you would use a "two-edge separation" task.

 

 

You might be getting thrown off by the timing of it:

 

If you don't configure implicit timing in your task, the measurement will start on the first edge after DAQmx Read is called.  So, in order to catch the signal you would need to configure your task, call DAQmx Read, and then fire your two edges.

 

If you want the task to monitor the signal continuously, then you should configure implict timing.  In this case, you'll receive a sample on every rising edge of your external signal (assuming both pulses on the same line)--if you start the counter task before you start generating pulses (which you probably should), then the even samples would correspond to times between pulses, the odd samples would be the time between each set of pulses.

 

 

More information about the counter modes on the 6221 can be found in the M Series User Manual.

 

 

Best Regards,

John Passiak
0 Kudos
Message 2 of 3
(5,952 Views)

Hey,

 

thanks for the reply John. I got it working. Actually it was simpler than I thought. With my first attempt I was simply missing the "implizit" timing configuration, which is definitely needed. So thanks again.

 

regards,

 

Paul

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