Stopping the DAQ Assistant or clearing a task does not autmatically set the output voltage back to 0 or any other voltage. The DAQ card will retain the last programmed voltage until you send it a new one. After the while loop stops, use another write to set the voltage you want.