07-24-2020 04:26 AM
07-24-2020 10:24 AM
The very slight tweaks I applied to your code back in msg #2 were only focused on establishing hardware sync between the AO and AI tasks so that you could get *consistent* behavior.
In your present situation you describe running continuously or else putting "my code" into a While Loop. So of course there will be idle times between runs as the tasks get cleared and then reconfigured.
To change the output signal without those idle times, you need to let the task keep running continuously but write new waveform data to it. If your waveforms are always full periods of a sine wave, 0 phase (so they start and end at 0 output), the transitions should be pretty seamless.
The earlier code sets up continuous tasks, but limits the # loops over which AI data is read. You could make that a while loop and, at appropriate iterations, write new data to the AO task.
-Kevin P