Hey all,
In the application I'm currently coding I'm using this exact example code, only with a read position function included in each loop iteration and the output wired to an XY graph instead of just waveform. Firstly, I'm encountering an error:

Error -200279 occurred at DAQmx Read (Analog DBL 1Chan 1Samp).vi:1
Possible reason(s):
Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.
Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.
Property: RelativeTo
Corresponding Value: Current Read Position
Property: Offset
Corresponding Value:
Task Name: _unnamedTask<17>
Can someone help me to troubleshoot this? I'm a bit confused by the fact that I'm only reading 1 sample and yet it appears as though I'm reading in too much and information is being overwritten. That said, I'm not sure why all the data points appear on my graph given the error.
The second issue is that I'm trying to optimize this code so that I can get data as quickly as possible while still maintaining synchronization... So I'm wondering how much leeway was built into the 25ms pause in the loop iteration, and any other tips for making it go faster.
Thanks