LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog output keeps same value when I pause my while loop

I have a For loop set for a number of iterations, inside that I have place a while loop, and within the while loop I have a sequence which is designed to change output an analog voltage to turn on and off a device. I have placed a True False wired to my 'continue if true' portion of my while loop -- when I make this false the analog output remains at the same value it was before -- how can I make this output go to zero when I pause/stop my while loop?

Thanks,
Travis
0 Kudos
Message 1 of 5
(3,143 Views)
Hi Travis,

I'm guessing this is an NI board. By design analog output will hold whatever value you write to it. If you want it to go to zero you have to set it to zero.

Regards,

Doug Norman
0 Kudos
Message 2 of 5
(3,143 Views)
Place a numeric constant = 0 inside your while loop. Wire it outside the while loop to your function (outside the while loop) to set the analog voltage. Then, whenever the while loop stops, you'll set the voltage to 0.

"Pause/stop" your while loop? There's no way to programmatically "pause" a while loop. You can setup a case within the while loop to skip certain functions when a "Pause" button is pressed, but the while loop will continue to run. When the pause button on the toolbar is pressed, all execution is paused: you can't trap that pause button and do something if it's pressed.
0 Kudos
Message 3 of 5
(3,143 Views)
Do you have a sample code of this that I could view?

thanks
0 Kudos
Message 4 of 5
(3,143 Views)
Here's a LabView 6.1 sample.
For the real application, instead of just writing to the Voltage indicator and local variable, call the sub-VI that sets the voltage twice (once inside of the loop and once outside of the loop). Because of the LabView data dependency model, since the input for Voltage for the sub-VI outside of the loop will come from inside the loop, the output won't be provided until the loop is done, and the subVI outside of the loop won't run until then.
0 Kudos
Message 5 of 5
(3,143 Views)