Hello, I have a program that should send a waveform (a sine wave for example) to several channels of an NI multifunction board. This board has multiple AO channels and I want to use all of them. The user should send waveforms (can all be different) at any time and the resulting voltage and current should be displayed live.
Normally you would simply send the entire waveform array to the DAQmx write function and read it back every 100ms or so. But I want that while one waveform is being read (can lasts several seconds) the user should be able to send another waveform on another channel. With the DAQmx write function you have to send the entire waveform for all channels at the same time, which is not good when one waveform has already been written.
My strategy for this problem is to divide the waveform into pieces of 100ms worth of points. Then send those pieces every 100ms while the input is read continously. I've attached a test VI that I quickly made (sorry for the messiness). You can send a waveform to either channel 0 or 1 and any time and also while there is already a waveform being send. It works, but at high sample rate, the signal jitters at regular intervals. Like this:
I've been trying to use the buffer as follows: Add 200ms of data and then every 100ms after that add another 100ms of data. In this way there should always be between 100 and 200ms worth of data in the buffer, but jitter still remains. In fact there is no jitter the first 200ms and then it it appears. So it seems to me that the buffer is not properly used. I'm not sure how to properly use it. Can anybody help with this problem?