06-12-2010 01:47 PM
Solved! Go to Solution.
06-14-2010 10:42 AM
Hi Sheldon,
First, please reference this article and see if this provides any insight to this issue. Also, did you have an error code with the message that you are seeing? Is the error code the same as in the article?
Here is another article over memory overflows and how to work around them. One of the two should have the information you are looking for.
06-18-2010 03:15 AM
Hi Kyle,
The error after calling the DAQmxReadAnalogF64 is -200361. However I don't understand how it could be a Buffer Overflow Error. I have a dedicated thread that reads the data from the channel using DAQmxReadAnalogF64. It does nothing else. The first few times (Starting and Stoping the task) the program works with no errors.If I change the sample rate to 100 and the buffer size to 10000, then I don’t see how the buffer could overflow as I am consistently reading the channel.
I only have this problem if I start and stop the channel a few times.
Does NI have a C++ example that use a separate thread that calls the DAQmxReadAnalogF64 Function to read the samples?
Sheldon
06-21-2010 02:55 PM
Hi Sheldon,
This error is associated more with the communication from the USB-6009 to the PC. Typically, USB communication has a high amount of latency which inhibits the data transfer from the USB to the OS. Also, Windows is non-deterministic, which means the time between transfers vary depending on the tasks running within the OS and the priority of those operations.
The USB-6009 has a relatively small FIFO, which means if you are acquiring data at a fast rate, you can easily overflow the FIFO if the CPU is being used extensively while an acquisition is happening. It could be possible that when starting/stopping a task several times could cause the CPU to ramp up and slow down communication enough to prevent the data transfer speeds from being where they need to be.
What operating system are you using on your PC? What is your sampling mode? You can try and use finite sampling mode, which will allow you to control when you need to stop and how many samples to read off at a time. If you go to Start » All Programs » National Instruments » NI-DAQ » Text-Based Code Support » Visual C++ Examples, you should be able to find the complete list of text-based examples for DAQmx.
01-18-2011 01:27 PM
I am seeing the same memory overflow problem wiith a USB-6009 using SignalExpress running at its default setting of 1K Hz. If I drop the analog input step and start/stop a few times this error occurs. The operating system is Windows 7 64 bit.
I found by running Windows XP as a virtual machine within the same environment the problem does not exist. SignalExpress and USB-6009 running of the XP virtual machine OK. Is it a Windows 7 driver issue?
01-19-2011 09:46 PM
Sure it is possible. What version of DAQmx and Signal Express are you using?
01-20-2011 09:51 AM
I'm running Labview SignalExpress 2010 4.0.0 and NI--DAQmx 8.9.5. Thanks for quick reply.
01-20-2011 10:05 AM
The operating system we are using is Windows Embedded Standard SP3, but I have the problem on Windows 7 also.
The sampling mode is DAQmx_Val_ContSamps as I need to always read the data.
It seems that if I load the program, capture data, then exit. Then load the program and repeat the problem does not occur. If I start/stop the task in code randomly the error occurs.
Sheldon
01-21-2011 02:38 PM
Try to make sure you have other applications minimized or closed during acquisition. This should help - you can also monitor your CPU usage and see how the CPU is performing during the multiple start and stops. Depending on how your are starting and stopping the task you can be adding unnecessary overhead by creating a task everytime, instead of creating it once and running a continous acquisition. I think Kyle made some good points how starting and stopping the task could ramp up your CPU usage.
All-in-all it looks more to be product of:
If you need more throughput I would switch to PCI.
http://digital.ni.com/public.nsf/allkb/611475F9BE62881E86256FDC0062B1BB?OpenDocument
01-21-2011 03:13 PM
Normally the program does not start/stop a task. It starts the task once, but if I even try to stop (task using one channel) and then create a task with two channels I run into problems with the Buffer Overflow Error. No other programs are running and the CPU usage is showing 0%-5%.
My only guess is that something is happens when the NI dll's are unloaded or the time it takes to exit the program and start up again that it doesn't get the Buffer Overflow Error when repeatedly loading/closing the program.
I can load the program, start a task, stop the task, exit the program and repeat and I have no problems.
If I load the program, start a task, stop the task, create a new task then I got the Buffer Overflow Error.
I guess I just have to test different ways to see if I can find some method that will allow me to start/stop a task without getting a Buffer Overflow Error.
Sheldon