Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Error in DAQThe requested memory could not be allocated Status Code:-50352

I Created two tasks for channel 0-11 for writing Data, and from 12-19 for Reading Data.
 
Here is the posrtion of the code:--
 
static TaskHandle  InputTaskHandle = 0;
 uInt16 readArray[1000];
 
 chkDaqErr(DAQmxCreateTask ("DaqmxInputTask ", &InputTaskHandle));
 chkDaqErr(DAQmxCreateDIChan (InputTaskHandle, "Dev1/line12:19", "", DAQmx_Val_ChanForAllLines));
 chkDaqErr(DAQmxCfgSampClkTiming (InputTaskHandle, NULL, sampleRate,DAQmx_Val_Rising, DAQmx_Val_ContSamps, (uInt64)1E9));
 chkDaqErr(DAQmxReadDigitalU16 (InputTaskHandle,numSamples, 1.0, DAQmx_Val_GroupByChannel ,
  readArray, 1000, &sampsPerChanRead, 0));
I am getting the error at this point ->DAQmxReadDigitalU16
Errorr is
Error in DAQ writing format to NI-6537->The requested memory could not be allocated.
Task Name: DaqmxInputTask
Status Code: -50352
 
I am attaching the code also.
 
Please can you tell me where its going wrong?
0 Kudos
Message 1 of 2
(3,236 Views)
Hi Molugu,

In continuous mode, the sampsPerChanToAcquire parameter of DAQmxCfgSampClkTiming is used to determine the buffer size. You are specifying 1e9 samples. If each sample is 4 bytes, that requires a 4e9 byte buffer, which is about 3.7 GB. If each sample is 2 bytes, it's still a pretty large buffer, and I don't know how much RAM you have in your PC. Try reducing sampsPerChanToAcquire.

Brad
---
Brad Keryan
NI R&D
0 Kudos
Message 2 of 2
(3,226 Views)