LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use counters to read the difference between two external pulse signals?

I generated a pulse signal and sent it to a sensor which in turn gives me a pulse signal back. I need to read the time from which the sent the signal goes high to the time that the signal is returned. How can I read this? the diagram is attached
0 Kudos
Message 1 of 4
(3,011 Views)
Hello;

The way to accomplish that is by using one of the 660x boards, and configure the counter to do "Edge Separation Method".
That method will increment the counter event count value every time a pulse comes into its source input. The counters only increments between the rising edge of the aux line and the rising edge of the gate. The current value of the counter is read when the counter is finished or an error occurs. You need to wire the out pulse to the AUX line, and the return pulse to the gate line of the counter.

Hope this helps.
Filipe A.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,011 Views)
Thanks Filipe, there is one more thing. Please bare with me, I am a New user of LabView and am not clear as to how to configure the counter. How would I go about doing that? Also, Is there any way of doing that with boards other than the 660x?
0 Kudos
Message 3 of 4
(3,011 Views)
There is vi called "Two Edge Separation Mesurement (NI-TIO).vi". In LV6.1 it is in "c:\...\LabVIEW 6.1\Examples\DAQ\Counter\ni-tio.llb".

Unfortunately this function has no timeout. This means that your program will hang on if there are no pulses. I have attached an improved version of this vi with a timeout(sorry for the french text in the description). There are also some other improvements like the calculation of the edge separation in seconds (not only clock counts).

This function will only work with NI-TIO cards (like 660x).
0 Kudos
Message 4 of 4
(3,011 Views)