Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Onboard device memory overflow

Dear National Instruments users and developers,

 

I’m experiencing a frustrating error with the USB-6251 andOEM-6251.  When I attempt continuousanalog acquisition from 8 channels at 100 kHz per channel (800 kHz aggregate),I receive the following error after ~15 seconds of recording:

 

Measurements: Onboard device memory overflow. Because ofsystem and/or bus-bandwidth limitations, the driver could not read data fromthe device fast enough to keep up with the device throughput.
 
Reduce the sample rate, or reduce the number of programsyour computer is executing concurrently.

 

My application, written in C# using Measurement Studio, uses<10% of my CPU.  The total CPU load is~15% with all other applications combined. My application requires this sampling rate to be of use.

 

I’m testing and developing on a Dell XPS M1330 with 2 GB ofRAM and a Core 2 Duo 2.2 GHz processor and Windows Vista (SP1).  I’m using NI-DAQmx 8.9.  The USB-6251 is attached to a USB 2.0 port.

 

There are two more pieces of information that may help solvethis puzzle.  I tested the program on aslightly faster computer (Dell Hybrd, 2.4 GHz Core 2, 3 GB RAM) and the error didnot occur.

 

Second, when using Measurement and Automation Explorer toread a single channel on the original computer (XPS M1330), I receive thefollowing error when reading at 1 MHz with a 10 kSample buffer:

Error -200279 occurred at Test Panel
 
Possible Reason(s):
 
Measurements: Attempted to read samples that are no longeravailable. The requested sample was previously available, but has since beenoverwritten.
 
Increasing the buffer size, reading the data morefrequently, or specifying a fixed number of samples to read instead of readingall available samples might correct the problem.

 

When doing the same test with 1 kSample buffer, the errortakes many minutes to occur.  When usinga 100 kSample buffer, I can’t get the same error.  For my Measurement Studio application, I’veused a variety of buffer sizes with no effect on the error.  The Measurement and Automation program usesabout 30% of the CPU when running.

 

My questions are:

1) Where is the bottleneck that causesthis error in my application, if the CPU has so much headroom?
2) The NI site claims that the USB-6251 can performsustained high speed acquisition at 1 MHz, and I’m going at 80% of this andfailing.  Why?
3) If this is a result of the particular machine I’m testingon, what are the minimum specifications for running a USB acquisition at fullrate?  What should I tell the end usersabout their minimum CPU speed and memory size?
0 Kudos
Message 1 of 15
(7,318 Views)

There are two possible bottleneck points happening, one could be the USB bus, and I would attempt your program with no other USB devices hooked up to make sure you are getting the maximum speed out of that.  The other issue could be in your software.  If you are reading in your data in the same loop that you are writing to disk and/or doing some other things this can slow down the rate of transfer off the card and cause this error.  I would recommend you check out the following KnowledgeBase Article.

 

Buffer Overflow

 

Doug

Applications Engineer

National Instruments

Doug Farrell
Solutions Marketing - Automotive
National Instruments

National Instruments Automotive Solutions
0 Kudos
Message 2 of 15
(7,300 Views)
Thanks for the suggestions, Doug.  I've ensured that nothing else is plugged into the hub, and I've changed my while loop so that it's nothing more than incrementing a counter (e.g., ++a where a is an int).  The problem still arises.  In this case, the applications is taking less than 1% of the CPU, compared to 10% in the normal, full-analysis application.
0 Kudos
Message 3 of 15
(7,294 Views)

I think we can both be certain this is not an issue with your CPU usage after your tests yesterday, that leaves us with the USB bus.  I would imagine, because the computer causing you grief is a laptop, that this is the issue.  Laptop's sometime sacrifice their USB port's speed for reduced power consumption.  That would also explain why this is able to run on a similar computer that is a desktop.

 

Doug

Doug Farrell
Solutions Marketing - Automotive
National Instruments

National Instruments Automotive Solutions
0 Kudos
Message 4 of 15
(7,280 Views)

I am now using NI USB 6008 and I had the same error -200361 :Onboard device memory overflow. However, I noticed that the error occured only when I tried to config the timing, for example uing "DAQmx Timing.vi". If I just run the device without Timing, at max speed I guess, there is NO error, no matter how long I run or switch on/off many times.

This may solve the problem but I can't tell how fast the device's sample rate is because I don't know the exact value of dt. I know the maximum sample rate of the NI USB 6008 is 10kS/s, but when I measure a sine wave signal at a preset frequency and set dt = 0.0001 second (equivalent to 10kS/s), I got the frequency of the sine wave only half of the right value. To have the correct frequency value, I had to set dt = 0.00005, and that means the sampling rate is 20kS/s. That makes me really confused ! Did I make something wrong ? or the device is defect ?

0 Kudos
Message 5 of 15
(6,056 Views)

Hi,

 

What configurations were you using to get that error with DAQmx Timing. vi? I pretty sure it isn't possible to sample at 20kS/s with the USB 6008. How are you measuring the sine wave frequency and what were your expected and measured values? Here is a KB that gives more information about the error you are getting. 

Rohama K.
0 Kudos
Message 6 of 15
(6,047 Views)

 

"DAQmx Timing. vi" was configued with 1kS/s, 1000 sample. I changed to lower sampling rate, smaller number of sample, but the error still occured. By the way, the measured signal is from 3.5 audio port on computer. I used an audio tune generator program to create that. Is that a problem ?

0 Kudos
Message 7 of 15
(6,044 Views)

Hi qtiem,

 

I’m not sure about what you are trying to do. I read that you are not able to get the frequency of the sine wave that you are trying to measure, what are the characteristics of this sine wave?

 

When measuring  an input signal, we use the Nyquist theorem, this theorem says you will need to sample at least twice as fast as the input signal, but this is only to get the frequency information of the signal. To get the amplitude and shape, you need to go at least ten times the input signal frequency.

 

The maximum sampling rate for this USB-6008 is 10KS/s, this means that the input signal needs to be at most 1KHz, the recommended amount of samples to read will be 1KS.

 

The error that you have can disappear if you reduce the amount of processes running in your computer, also, you need to be aware of what the read while loop that I assume you have in your program is doing. If the program is running more processes that the acquisition itself in the main loop, you might not be able to read from the device buffer as fast as the device is acquiring data.

 

Also, are you using windows XP or windows 7? What version of DAQmx do you have? I would like to know more about your application and your system configuration. You can also send us your VI.

 

I hope this will help you with your question above about the sampling rate, and also in the development of your application.

 

 

Regards,

steve.bm
AE | NI
0 Kudos
Message 8 of 15
(6,032 Views)

sample rate issue.jpg

 

Please see the above picture for more detail.

 

Sine wave signal from audio port (left channel) is connected to AI0-AI4 of NI USB 6008 (differential mode). Run audio generate program (top right corner) and set frequency at 50Hz (sine wave).

A simple VI program is to capture the sine wave and extract freqnency. No timing for the this VI so I think ADC will be at maximum sampling rate.

The strange thing is that when I set dt=0.0001 (10kS/s), the frequency is read 25Hz. This is not correct because the input sine wave is 50Hz. Then I set dt=0.00005 (20kS/s), the frequency is read 50Hz, correct value !

 

I don't know what's wrong with the 6008 ? Or I misunderstood anything ?

0 Kudos
Message 9 of 15
(6,024 Views)

The above VI is without timing and I can only run this with no buffer overflow error. Whenever I add "DAQmx Timming.vi", the program fails after a couples start/stop.

0 Kudos
Message 10 of 15
(6,021 Views)