Hello
Dimitris,
I took a look at your code and noticed a few things that I wanted to comment on. The buffer size is set to '0'. The buffer size is the number of samples the buffer can hold for each channel in the task. Zero
indicates to allocate no buffer. Use a buffer size of
0 to perform a hardware-timed operation without using a
buffer. Is this what you would like to do in your application? In not then you don't need to use the Configure Buffer VI, the DAQmx driver will determine the buffer size you need from the rate and number of sampling data you supply.
In your code, when setting the sample clock you had it set at a sampling rate of 1000Hz and 1000 samples per channel. Since you are setting the sample mode as Continuous Samples, DAQmx uses this value to determine the buffer size. Only in Finite Sample mode does it specify the number of samples to acquire or generate for each channel in the task.
I recommend that you remove the configure buffer vi. In your while loop the DAQmx read should be configured similarly with something like the following: Analog>>Multichannel>>Single Sample>>1D Waveform. Remove the 1000 sample constant on the sample clock. Do you need the wait 500ms in your while loop?
Give these suggestions a try. Let me know if you are running into any difficulties.
Regards,
Sandra T.
Applications Engineer | National Instruments