billings11,
No magic bullet here, but maybe some partial help.
First, you started the thread saying, "
I need to generate a waveform for 60 seconds." Then you talk about generating a continuous waveform and calling 'DAQmx Stop.vi' after 60 seconds. So I assume you're defining a small-ish buffer and using regeneration to keep repeating it. I don't have hw here to check, but isn't it possible to use regeneration with a finite # of samples? Then you could just set the # of samples to be an integer multiple of the waveform buffer size and the analog output would naturally stop at the end of your buffer, where the waveform is returning to 0 anyway (I assume).
Second idea is more of a pain. If you can't have both regeneration AND a finite # sample output, then configure for finite # of samples where # is an integer multiple of your waveform buffer. Then you'd need to launch a process that keeps feeding chunks of that waveform to the DAQ buffer using 'DAQmx Write.vi' at appropriate times. You'd probably need to experiment to find a good compromise among buffer size, size of feed chunks, feed frequency.
Third comment is a reference to a slightly related thread I was involved in before. I linked in a utility to help make the best fit between output rate, actual waveform period, and buffer size. It's for cases where the waveform period isn't an exact multiple of the output clock period. I originally worked on the idea when dealing with a similar motion-control problem. It helps make a smoother command function when cycling from the last defined point in the buffer back to the first. (BTW, our solution to the problem you're facing was much simpler because we were running real-time and calculating individual AO outputs every loop cycle. That made it easy to generate a ramp to 0 because we automatically knew what the last output voltage was.) Anyway, here's the
thread.
-Kevin P.
ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.