Hi Bob,
the clear task removes the task configuration from memory. It does not reset any values back to a "default" value, since everyone's defaults are slightly different.
You need to programatically set it back before clearing the task.
You're also effectively trying to gate the analog output using the pulse from the counter. This can in theory be acheived by running three counters.
One produces a pulse which is effectively your time to do the AO for, and the other two uses the edges of this pulse to generate individual pulses, so you get a pulse on every edge of the first pulse. Unfortunately that then means an external OR gate to tie the two outputs together and you can put the single pulse train back in to control the AO which would have a buffer which is voltage, 0v, voltage, 0v etc.
An easier solution then would be to run some external circuitry for the gating of the AO, like a FET or a fast acting relay.
In software terms you could wait until your task completed for the pulse generation and then programatically stop the analog output, or knowing the length of the pulse you want to generate, you could do a finite analog output with the last point in the array being a zero, so it definitely finishes where you want it to.
Hope that helps
Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer