I'm watching to see if there hasn't been a sample output in a certain length of time, then terminating the task if there hasn't been. Specifically, I have ctr0 outputting pulses to drive the task based on input from the AnalogComparisonEvent terminal. I'm using a counter on a different PXI device to count the number of pulses and monitoring this count to determine if another sample has been output. I'm outputting the ctr0 pulse to PFI3 as well, and I'm monitoring both the ctr0 output (which drives the ao clock) and the analog output itself on an oscilloscope.
Basically I'm sitting in a while loop waiting for the monitoring counter to fail to increment. Then I terminate the while loop and stop the analog output task. I can watch the analog output on the oscilloscope while I step through the program. Immediately before the daqmx control task - abort (or daqmx stop if I don't abort first, or daqmx clear, if I don't abort or stop) vi runs, the analog output remains outputting the last sample. Immediately after the abort, stop, or clear, the analog output advances one sample in the buffer.
During this time, ctr0 does not output another pulse, so the scan clock should not advance.
Thanks,
Marc