06-06-2011 10:53 AM
I am using the USB-6221 to determine the time intervals between digital signals. I am using a LabVIEW program to record the time between the leading edges of two input pulses (TTL "1"s). This worked fine, but for no apparent reason it stopped registering signals if they were within about 12.5μs or less of each other; it does not recognize the second signal. It did work for time intervals down to 1μs until about last Thursday, but then it stopped working. I did not change the VI nor any other settings as far as I am aware between when it did work and did not. I have tried an older version of the VI that is known to work (attached), but it also fails below 12.5μs. I have also tried using a different USB-6221, but the same problem arose (except at about 13μs).
I am using two "Digital and Timing I/O" inputs, and have used a pulse generator and oscilloscope to check that the incoming signal is actually working as expected, and I have verified that the detections start failing at around 12.5μs or shorter gaps between the leading edges of the two incoming signals. All my equipment seems to work as expected up until the USB-6221.
I really have no idea what the issue is, so I have tried to mention everything relevant. Any advice would be much appreciated.
Solved! Go to Solution.
06-07-2011 11:17 AM
Hello Greg,
I had a look at your code. Have you tried setting the DAQmx Timing function to Sample Clock and select a rate/ clock source? The system may have selected a slower time base (implicit) which may not be sufficient to measure short pulse separations.
Eric
06-07-2011 01:20 PM
I tried switching to Sample Clock with a rate of 2,000,000 samples per second (.5μs per sample) and got this error upon running the program.
Error -200300 occurred at DAQmx Start Task.vi:1
Possible reason(s):
Measurements: Invalid timing type for this channel.
Property: SampTimingType
You Have Requested: Sample Clock
You Can Select: Implicit, On Demand
Task Name: _unnamedTask<2>
06-08-2011 12:15 PM
You need to stay with "Implicit" timing, but you can set up a specific high-res timebase through
a DAQmx Channel property node. Like this:
Somewhat counter-intuitively, you can't do this through a DAQmx Timing property node
when you're using Implicit timing. I guess it kinda makes sense, but it wasn't my first
inclination to look under Channel properties instead of Timing properties.
-Kevin P
06-08-2011 02:15 PM
That did the trick. Thanks a bunch!
08-05-2011 04:45 AM
Hi,
I am having some trouble with the same problem.
I implemented Kevin's code, but now, my question is: How do I get the time between two rising or two falling edges now?
Could someone please explain.
08-08-2011 09:55 AM
Hello Jak888,
You can define rising or falling edges on the create virtual channel VI. Have a look at the following link, it illustrates how to set up this type of measurement.
https://decibel.ni.com/content/docs/DOC-11417
Eric
08-09-2011 01:43 AM - edited 08-09-2011 01:45 AM
Thanks for the answer.
I found a posibility to measure the frequency using correlated DIO. This works quite alright. I still think that using edge detection would be a much better way, though.
I tried rebuilding your example, but the VI ended, telling me, that some samples had not been acquired (Error: -200284). Any suggestions on how to solve this?
Also I am not 100% sure if I connected everything right. I used the CTR 0 SRC for the signal wire and CTR 0 GATE for ground.
08-09-2011 05:37 PM - edited 08-09-2011 05:44 PM
Hello Jak888,
Depending on the card you are using, the Source pin may need to be tied to the onboard clock (done internally by the driver) and the signal inputted to the gate. What particular card are you using for your application (USB-6221)?
Eric
08-10-2011 12:41 AM
I am using a PCI 6221