LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measure time span between two events

We have a cylinder that we are trying to measure the extend and retract time of. There are switches mounted on the cylinder so that we know when the switch is fully extended and retracted. I need to know the time from when the retract switch goes off and the extend switch goes on and, similarly, when the extend switch goes off and the retract switch goes on.
Message 1 of 6
(4,376 Views)

What type of timing are you describing?  milliseconds? hundreds of ms? seconds..

 

Message 2 of 6
(4,372 Views)

Hi mes2483,

which hardware do you use to get the signal from your switches? Read the time if the first switch is active and store it in a shift register. After the second switch has the specified state subtract the old from the new one.

Hope it helps.
Mike

0 Kudos
Message 3 of 6
(4,371 Views)
We are measuring it in ms and using the DAQ 6009 analog input card. The voltage we are reading in from the switches is a +12Vdc analog voltage.
0 Kudos
Message 4 of 6
(4,369 Views)
Hi mes2483,

The USB-6009 is fairly limited in what it can do with timing measurements.  You might be able to get away with software timing, by polling a digital input in a loop.  However, you might not get millisecond level accuracy this way.  You could also sample the analog input, and use the Timing and Transition Measurements VI to determine the ON and OFF time of the signal, if it is pretty close to square wave.

Also note that all analog inputs must be within +- 10 volts of AIGND.  If you have 12 volts between your input and ground you may cause some damage.  The digital inputs are designed for 0 to 5 volt signals only.


Regards,

Jeremy_B

Applications Engineer
National Instruments
0 Kudos
Message 5 of 6
(4,330 Views)
One very simple way to implement this, though not necessarily very efficient is to record your contact closures as a waveform, and then use the waveform tools to give you the period between peaks.
 
eric
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 6 of 6
(4,311 Views)