It is not clear to me how your answer applies to my problem. I want to execute a perpetual loop. At the beginning of every cycle through the loop I want to output one analog sample and read the next 200 analog input samples captured AFTER the analog output event. Then after I read these data, I will consume some more time in the loop doing computations,
during which time the ADC buffer is refilling with samples that I can't use.
It seems to me that I want to flush the buffer after the DAC update and wait while the ADC captures the next 200 samples. Can you say precisely how to do this?
Thanks for the question. From your description of the issue, it sounds like incorporating a producer/consumer structure to your program would help. Here is an example with a small description. Please let us know if you have more questions.
Additionally, I wanted to make sure that you were replying to the correct thread, since the original post was started over 4 years ago by another user. Please let me know if that document helps!