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?