Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Measure two edge separation

HI,
     I am using a PCI-6602 to measure the time between two digital pulses.
     For example, if each pulse happens at 1ms, 4ms, 11ms..... I should get a series of separations like 3ms,7ms.....
    However, if I use the example code " measure two edge separation" , I get no data at all.
    I tried to wire the signal to the gate and also tried to wire the signal to the source, but neither of them works. I am confused.
    Does anyone have any idea about where it goes wrong? Thanks a lot!

Charmaine
     
0 Kudos
Message 1 of 5
(4,573 Views)
Have you verified the timing and the correct voltage levels (TTL) of the pulses with an oscilloscope or other means?
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 2 of 5
(4,568 Views)
Are the two pulses coming in on the same wire or on different wires?
 
If same, you want to do period measurement with the signal wired to a "Gate" input.
 
If different, you want to do two edge separation measurement with the earlier pulse wired to "Aux" input and later pulse wired to "Gate" input.  The measurement only works one way -- from Aux edge to Gate edge.  For buffered measurements (using DAQmx Timing.vi), no overlap is allowed -- if a second Aux edge happens before the first Gate edge it'll be ignored.
 
-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 3 of 5
(4,565 Views)
   Thanks,  Kelvin. That helped a lot!  Smiley Wink
   But if I use "period" method, It seems to me that the counter only gives me data every "measurement time", and the " measurement time" can't be very small.
   So if I want all the separation time to be measured, what shall I do?
Charmaine
0 Kudos
Message 4 of 5
(4,557 Views)

To measure all edge-to-edge intervals of pulses coming in on a single wire, you'll need to do a buffered measurement.  Just insert the DAQmx Timing vi before starting the task.  For period measurement, the lower pull-down menu choice should be "Implicit."  There are terminals at the top of the vi to select Finite vs. Continuous sampling & # samples to acquire.

If you do this, all the measurements are done in hardware, you just have to call DAQmx Read to retrieve the values from the acquisition buffer.  None should be missing.

This explanation is based on guessing that you started and stopped a single unbuffered measurement repeatedly in a loop.  This would cause you to miss at least 1/2 the intervals, probably more.

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 5 of 5
(4,551 Views)