Hi Jena,
Although you have seemed to solve the error problem, I took a look at the code you posted and wanted to make some recommendations. First I would like the mention that the error you were receiving is normally associated with errors in buffer size. By increasing the sampling rate, you have allowed your system to sample at a faster rate into the buffer so there are more available samples to read out of the buffer memory into the PC. Therefore, you have overrun the timeout problem that you were receiving.
In addition, I noticed that you are reading your task directly in the loop and never closing out the resource. It is good programming practice to use the Start Task VI outside of the left side of the loop and the Clear Task VI on the righthand side. Therefore you can be sure that the task is only being started and cleared once. Here is a
link to a very useful tutorial about data acquisition problems that you might want to read through. There are examples in here about how to use those above mentioned VIs.
Also, you could look at some of the example programs that are available in the NI Example Finder. To access these, go to Help>>Find Examples. Then in folder directory, navigate to Hardware Input and Output>>DAQmx>>Analog Measurements. Then according to what you are measuring, there are data acquisition examples available. I hope this extra information helps!
Regards,
Vanessa L.
Applications Engineer
National Instruments