Hi Shukla,
There could be multiple causes to this error. Things that I would check to troubleshoot this problem are 1) Check to see if examples that are shipped with the NI-DAQmx driver are working. 2) This error could occur because of differences in the way that you have set up your channels and the way that you are actually reading your data. More specifically, check your DAQmxReadAnalogF64() or whichever read function that you are using to acquire your data. Another post that was dealing with a similar problem is
here. 3) Make sure that you are not trying to run analog input tasks in parallel and also could you tell me whether you are doing your acquisition in continuous mode or not. If you are acquiring continuously, you should check what you have set your sampPerChanToAcquire parameter as. 4) Make sure that you are specifying the correct amount of samples that you want to read and in some functions you specify parameters (for example "array size"), which needs to be in bytes and not in samples. Again,
here is another post that was dealing with a similar issue.
It would help if you could post your code so that I could take a look at it. As far as the little code that you posted in your first post, I do not really see anything wrong there.
Regards,
Raajit L
National Instruments