Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital TIming

Hey Everyone,
I have'nt worked with LabView very much and need some direction.  I'm trying to control and  read the Polaroid 6500 Ranging Module using LabView 8.2, DAQ: NI USB-6009.  Basically  I  need a loop to  set the  INIT  high at some time X  and measure the  time until the  ECHO goes high.  The time between the rising edges of the INIT and ECHO is what i need to measure.  I was thinking of attaching INIT to a clock that goes high for 30ms and low for 30ms and than trigger a timer on the rising edge of the clock that stops on the rising edge of the ECHO.  Is this possible?  Any feedback is appreciated.
Thanks,
Adam

0 Kudos
Message 1 of 4
(3,738 Views)
Hello Adam. 
 
Thank you for contacting National Instruments. 
 
The capability that you are describing is called two signal edge separation.  This process requires either 2 counters on a non M-series DAQ card or 1 counter on an M-series DAQ card.  Please refer to the example in NI Example Finder named "Meas Two Edge Separation".  This shows the functionality that you are looking for with an M-series DAQ device.  The M-series devices use the gate and aux inputs on one counter to do the two edge separation measurement.  Also, you could choose to simulate an M-series device using MAX and then place a DAQ Assistant on the block diagram to do a two edge separation measurement in a matter of seconds.
Unfortunately, the 6009 that you have cannot do 2 edge separation calculations because it only has one counter onboard.  I would recommend upgrading to an M-series device in order to do this type of measurement accurately. 
 
Brian F
Applications Engineer
National Instruments
 
 
0 Kudos
Message 2 of 4
(3,718 Views)

Thanks for responding.  At this time in my project I don't have access to a different DAQ.  Is there a way to use a program counter to start and stop a timer on rising edges..  It's for a academic project so accuracy is not essential.  All your input is appreciated.

Thanks,
Adam

0 Kudos
Message 3 of 4
(3,716 Views)

Hello Adam. 

There is a way that we could try to accomplish this task using a bit of a workaround.  However, I would like to stress that most of our other hardware can do this much easier. 

If instead of focusing on a counter solution, we focused on an analog input solution, we could get fairly accurate measurements.  What we could do is set up a DAQmx task to sample off of 2 analog inputs quickly (the 2 analog inputs correspond to the 2 digital signals of interest).  After a few seconds of acquisition, we could post process the data to determine when each signal experienced a rising edge.  Then, via the timestamps that correspond to the time when the input signal went high, we could determine the time between the rising edge of both of our signals.  This would give us a fairly accurate measurement of the edge separation, but the results would not be real time.  Thus, if you want to use this measurement to control some other process in your application and this measurement must be returned immediately after the second signal goes high, this solution will not be completely valid. 

You could also do something comperable with 2 digital input lines and continuously monitor their states.  However, this will be much slower since the digital lines sample at a slower rate than the analog channels. 

Let me know if this helps!

Brian F
Applications Engineer
National Instruments

0 Kudos
Message 4 of 4
(3,690 Views)