LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate 0 Volts at end of program

Hello,

I have made up a condition structure so that when the user presses the STOP button, the output is equal to 0 Volt. However, when I run the program, that value isn't taken into consideration. I supose the reason is that the program stops immediatly and hasn't got the time to generate the 0 Volts.

Would any body now how to solve this problem? Does a "waiting structure " that I could put between the Stop button and the "while red button" and set it for instant at 10 mS exist?

Any help would be great,

Thanks,

Marc
0 Kudos
Message 1 of 4
(2,708 Views)
Hello Marc,

You have several ways to do that...
I think that the easiest one is to connect another structure that will run after your while loop stops and there you can put all your stuff to do after program stops, don't forget to connect something to it that comes out of your while loop to guarantee that it will run only after the while loop is over.
The best thing you can do is to put your while loop inside a sequence structure, make a first page where you do all the initialisation, a second one with the program itself and a third one with the things to do after the program stops.

Hope it helps,
Paulo
0 Kudos
Message 2 of 4
(2,707 Views)
Your best bet is a better program structure to allow cleanup operations after you hit the exit button (or the windows close button, or the exit menu item...). This is usually done using the event structure to filter stop events and allow cleanup code to run. I have attached an NI-Week tutorial I used to demonstrate this structure.
0 Kudos
Message 3 of 4
(2,695 Views)
Hi DF Gray,

Thanks for your help. I'll check out your Zip file.

Marc
0 Kudos
Message 4 of 4
(2,681 Views)