12-21-2012 07:17 AM
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.
12-27-2012
10:04 AM
- last edited on
04-21-2025
03:05 PM
by
Content Cleaner
Hi Fabrizio,
try to take a look to this document, to see if you can find a cause of your issue:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019R42SAE&l=en-US
Hope it helps,
FBM
01-07-2013 01:20 AM
Hi FBM,
thanks for your reply. I'm just back now to work and I checked your link. Following my answers:
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
01-08-2013 02:46 AM
Hi Fabrizio,
how big is your buffer size?
Thanks,
FBM
01-08-2013 05:35 AM
Hi,
I have to measure 5 000 000 values of currents.
Thanks,
Fabrizio
01-08-2013
07:13 AM
- last edited on
04-21-2025
03:06 PM
by
Content Cleaner
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!
01-08-2013 09:08 AM
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.
01-08-2013 09:46 AM
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.
01-10-2013 02:46 AM
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.
01-10-2013 04:29 AM
Which sampling rate are you using?
Which is the rate you use to transfer the data outside the buffer?