Resolving DAQmx Error -50352 "Memory Cannot Be Allocated"

Updated Sep 20, 2018

Reported In

Driver

  • NI-DAQmx

Operating System

  • Windows

Issue Details

I have a program that makes calls to the DAQmx driver and it is returning Error -50352 "Memory Cannot Be Allocated."  How can I resolve this?

Solution

This error code can result from numerous causes:
  1. Various known issues related to this error message have already been corrected - please try upgrading your DAQmx driver to the latest version.
  2. Trying to Start a task that has already been started can cause this error. Make sure that any calls to DAQmx Start Task are outside of the read/write loop. Also, if using more than one DAQmx Write, try wiring a false constant to the autostart input terminal in LabVIEW (or passing the equivalent parameter using the C interface).
  3. This error can also occur when LabVIEW cannot find a large enough contiguous block of memory in your RAM to allocate as a buffer for your sample acquisition. By default, DAQmx automatically configures the AI buffer based on your sample rate, but you can use DAQmx Configure Input Buffer to manually create a smaller buffer. Please see this KnowledgeBase article for more information on how DAQmx allocates buffer size. Note: When you create a smaller buffer, make sure that your LabVIEW application can read the samples off the buffer fast enough so that you do not encounter a buffer overflow error (Error -200279).
  4. Try moving the DAQ board to different PCI slots. Also, make sure the example programs that come with NI DAQmx work properly. This will help to determine if it is a hardware or a software problem.
  5. Ensure that you are clearing your task at the end of the program;  if not, successive runs of the program may use up all of your system's memory, ultimately yielding this error.
  6. Ensure that your system has the latest OS updates installed. Running Windows Update Service on your machine and installing updates has been used to successfully eliminate this error in the past. 

WAS THIS ARTICLE HELPFUL?

Not Helpful