Hello Fred,
"1. Does anyone have any idea about how to optimize set up the input buffer size and how to check the buffer content or how much memory is used while running program? "
Normally, DAQmx will automatically set the input buffer size based on the number of channels being acquired and the rate of acquisition. Please see the DAQmx Help Manual for details on how this is done. This manual is very helpful in answering questions like this and can be found under Start >> All Programs >> National Instruments >> NI-DAQ >> NI-DAQmx Help.
"2. If this input buffer is full, the next coming data would be overwritten or just accumulated in other hard driver memory until the whole memory space overflow?"
If the buffer is full, the next incoming sample would overwrite the first sample in the buffer resulting in an error.
"3. Is this input buffer size is direct memory access, which take some hard driver space or other memory space?"
When you create an AI buffer, it is allocated in the PC's RAM, not the harddrive.
I hope this helps. Let me know if you have any further questions.
Regards,
Sean C.