06-30-2011 01:43 AM
I'm new to labview, and I have two signals both 5 volts. One occurs first and then the other one. I was trying to use true/false condition and converting data output of DAQ assistant into boolean and running a timer and then substracting two times. But I get really small time difference of 10ms, however its true values lies around 400 - 500ms. If you will give any suggestions please explain what the block codes do. Thanks.
07-12-2011 07:01 PM - edited 07-12-2011 07:04 PM
Unfortunately the 6501 doesn't have a lot of timing/triggering capabilities like the more expensive DIO/mixed-signal DAQs do. The 621x series might be a better option, or one of the X-series modules. Downside is $$$...
Rather than using the DAQ Assistant, use the DAQmx Create Channel VI (Digital Input polymorphic) and wire in DevX/Port0/Line0:1 (if you're using P0.0 and P0.1 as the two DI lines) to "lines", and "one channel for each line" in line grouping.
Use the ... blah, take a look at the attached example. Add some logic where the data indicator is. This example stops when both lines go high (both lines connected to gnd).
I'd recommend using the "get date/time in seconds" VI when the first line goes high, take that value and subtract it from anohter "get date/time in seconds" reading when the second line goes high.
If your application requires a little more precision (like, sub-millisecond resolution) I'd suggest a better DIO... but if a few msec error is acceptable, polling the DI lines and software-timing is probably the cheapest route.
07-19-2011 02:32 PM - edited 07-19-2011 02:32 PM
I am trying to do something similar but I'm using a single channel.
Using Labview with the MyDAQ and/or the 6024. I am trying to simply monitor a digital or analog channel and calculate the time between two events (two consecutive falling edges on a single channel). This is for an apparatus measuring an object falling through a tube triggering two spaced optical sensors that output falling edges of a 5v nominal signal when the projectile passes.
I am new to Labview and trying to figure out this basic experiment. I have found the Basic Level Trigger Detection VI . Is that a good tool for this or is there something more straightforward?
07-20-2011 09:00 PM
For digital signals, I would recommend using a digital counter task to accomplish the time measurement between 2 raising edges. Examples describing this can be found in the Labview example finder as shown below.
For analog signals, I prefer to acquire the data than post process to find the time difference between the two edges. The Basic Level Trigger Detection VI can be a helpful tool for accomplishing this.
07-17-2012 10:35 PM
I am trying to find the best way to measure the time between edges (to perform a simple estimation of RPM's). I am using Arduino (can't use DAQmx VI's), and I already could make something work using the concept of the VI that "panoramarts" shared. I have just one signal in (on , off) so when I measure the time, using the VI I mentioned (panoramarts), the program will calculate the time difference every TWO edges (1st with 2nd, 3rd with 4th, and so on), and not one after the other.
How can I solve this so it continuously gives the time difference of consecutive edges?
Thanks in advanced to anyone that can give a pice of advice on this.
07-19-2012 12:34 PM - edited 07-19-2012 12:35 PM
You can use the following example to measure the pulse width of a digital signal:
Also, you can use Meas Semi-Period to measure the high and the low pulses of a given signal. For every measured period two data points will be returned.