Well, the Stop function will certainly work but it's not usually recomended. The problem with it is that you might have active hardware, open file references, etc. that should be properly closed. If you have a pop-up, process the Boolean (or whatever it is in your program that causes the pop-up) in your VI to stop whatever is still running. It might be as simple as passing that value to the termination terminal of a while loop. An orderly shutdown should be a part of the overall program design and not an afterthought.