Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

The requested memory could not be allocated USB 6259

Hi,

I'm running a C++ code to use the USB6259 to read 16 channels current.

Very often I got the error: NI Platform Services:The requested memory could not be allocated.

When calling the function: DAQmxCreateAICurrentChan ( I hope since it's not easy to get the right point).

 

The error could happen also the first time I'm measuring as also after many successful times. It's reproduced on different machines always Win7 32bits with more than 3GB RAM (latest NI driver installed). The total amount of currents to measure is around 5'000'000. Once the error happens is not possible anymore to let it works but it's necessary to reboot the system.

 

Thanks.

0 Kudos
Message 1 of 17
(4,685 Views)

Hi Fabrizio,

 

try to take a look to this document, to see if you can find a cause of your issue:

http://digital.ni.com/public.nsf/allkb/00A43B6D38EB768E86257537000120BB

 

Hope it helps,

 

FBM

0 Kudos
Message 2 of 17
(4,653 Views)

Hi FBM,

 

thanks for your reply. I'm just back now to work and I checked your link. Following my answers:

  1. Yes, I'm already using the latest software version.
  2. It occours also during first time running the task after a reboot.
  3. I'm using the USB ADC and it happens on different computers/USB port.
  4. Yes I'm allocating a big buffer size but actually I need it.
  5. See point 1. 
  6. See point 2.

 

So analyzing the proposed solution the point 4 seems to be the possible error source but as I mention I cannot reduce the buffer size. Is there any way to increase the memory space reserved to the task to avoid this error or any other suggestions?

 

Thanks.

Fabrizio

0 Kudos
Message 3 of 17
(4,621 Views)

Hi Fabrizio,

 

how big is your buffer size?

 

Thanks,

FBM

 

0 Kudos
Message 4 of 17
(4,606 Views)

Hi,

I have to measure 5 000 000 values of currents.

 

Thanks,

Fabrizio

0 Kudos
Message 5 of 17
(4,598 Views)

Hi Fabrizio,

 

if you look at the specs of the USB 6259, you can see that the buffer size mantains at most 4095 samplings, so you have to empty the buffer before it's full, transferring the samplings in some way (just like a FIFO or so on) and then you can use the points in the way you need.

If you're a LabVIEW user too and know how's built a producer/consumer structure, that's what I mean.

 

Have a nice day!

0 Kudos
Message 6 of 17
(4,594 Views)

Hi,

 

yes, this is exactly what I do. During the measurement the buffer is continuosly empty with a FIFO policy. The same code/function is used also in a different application where less samples have to be read and the "memory allocation error" happens rarely.

 

From what I see the memory allocation error happens during init phase even before the data is read. The number of samples to read is passed to the instruments just to now when the measurement is over.

 

Thanks.

 

 

0 Kudos
Message 7 of 17
(4,591 Views)

I see, so how many elements are in the device buffer during the execution?

After the problem appears the first time, maybe it can happen also at startup, since the device buffer can contain the old data that come from the last execution.

0 Kudos
Message 8 of 17
(4,585 Views)

Hi,

 

I don't know exaclty how many samples are in the buffer since the buffer is empty with a fixed delay since the measure is continuosly. Anyway this delay is related to the acquisition rate in order to avoid buffer filling.

Regarding the startup I mean computer reboot. While when the error happens is not possible anymore to let it work without reboot the system, as you said.

 

Thanks.

0 Kudos
Message 9 of 17
(4,565 Views)

Which sampling rate are you using?

Which is the rate you use to transfer the data outside the buffer?

0 Kudos
Message 10 of 17
(4,560 Views)