Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6221 not detecting high frequency digital input

Solved!
Go to solution

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.

0 Kudos
Message 1 of 15
(4,087 Views)

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

 

Eric Liauw
Senior AE Specialist - Automated Test | CLD | CTA
National Instruments
0 Kudos
Message 2 of 15
(4,066 Views)

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>

0 Kudos
Message 3 of 15
(4,063 Views)
Solution
Accepted by topic author Greg B.

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:

 

 

 

timebase.png

 

 

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

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 4 of 15
(4,038 Views)

That did the trick. Thanks a bunch!

0 Kudos
Message 5 of 15
(4,028 Views)

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.



Remember Cunningham's Law
0 Kudos
Message 6 of 15
(3,785 Views)

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

Eric Liauw
Senior AE Specialist - Automated Test | CLD | CTA
National Instruments
0 Kudos
Message 7 of 15
(3,744 Views)

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.



Remember Cunningham's Law
0 Kudos
Message 8 of 15
(3,731 Views)

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

Eric Liauw
Senior AE Specialist - Automated Test | CLD | CTA
National Instruments
0 Kudos
Message 9 of 15
(3,713 Views)

I am using a PCI 6221



Remember Cunningham's Law
0 Kudos
Message 10 of 15
(3,699 Views)