Thursday, February 25, 2010

National Instruments USB-6501 minimum sampling interval

I have a project where I need to collect some parallel digital data with a computer and store it in a plain text file. Ideally the file would look like this:

t (s) Value
0.000 130
0.005 127
0.010 126
0.015 127
0.020 200

Value is the decimal equivalent of 8 individual binary data lines.

This data collection could be achieved via the parallel port with custom software, however I'd rather use USB, and I'd also like to collect 2 separate 8-bit signals. I've used National Instruments products before, and figured the USB-6501 might be a good choice for this project. I called NI, and asked specifically about the sample rate. The technical salesperson did not have a clear answer. The best answer was "about 900Hz", but it was unclear whether this referred to the sample rate of a single digital line or all 24 lines that the device provides.


I bought the USB-6501 and tested it out with the included SignalExpress freeware from NI. As it turns out, the minimal sampling interval for two 8-bit signals is about 15ms (eg 67Hz) on my Core2Duo 2GHz with USB 2.0. Yeesh. I think that's pretty lousy, and it will not work for my application.

What's really annoying is that the program will not indicate what the minimal sampling interval is. You just have to take a guess and then run the data acquisition and test it. I also noticed that generating a CPU load on the machine will cause the data acquisition to halt if the minimal sampling interval cannot be reached. So, if you keep lowering the interval, keep retesting, and find that 15ms appears to work, you may find when you start another program or move a window, the CPU becomes ever-so-slightly more loaded and the acquisition will fail. Oops. Overall, the USB6501 is only good for very low-speed applications.

I will continue my project with an NI USB-6008 and use a digital-to-analog converter to convert my 8-bit signal into an analog voltage, then use the 6008 to record the voltage. It seems a little backward, but I cannot see any other low-cost high-speed digital USB devices from NI. Do you have any suggestions?

3 comments:

  1. Ben,
    Thanks for the information. I am running into the same problem. Most manufactures do not specify what the actual maximum sample rate of a byte input or bit input (for USB I/O). It seems crazy that they either do not know or do not want to say..

    The spec sheet tells you full USB2-12Mb/interface but that doesnt mean you will get the DIO speeds you need. Several bottle necks in the way.

    For my application I need to pull in 16 bit word at least 10k/sec.

    Thanks again. I almost spent $100 for nothing.

    I will call NI anyway and push for a answer.

    Mike

    ReplyDelete
  2. Mike, apparently the USB-6501 does not have its own timebase. Every sample must be initiated by the computer's CPU. So, the computer must send a request out USB, the device takes the sample and sends the data back. If the computer's CPU gets busy, it just doesn't send the request. Dumb. It seems like building the 6501 with its own time base (like the USB-6008) would have been easier and provide several orders of magnitude better speed performance. Let me know if you find a good high-speed digital solution. Good luck -Ben

    ReplyDelete
  3. A solution using FT245R should do it. I don't recall if it can generate its own timebase, or if you need to run, say, a NE555 timer to pace it. It has an onboard buffer, of course, so it will interact OK with a busy PC. It can also indicate to the outside when the buffer is full.

    ReplyDelete