LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How should I make a popup cancel window?

I'm making an application where a VI goes on for long periods of time without user input or feedback. I'd like to give the user an option to cancel the process as well as get some feedback on the elapsed time. I thought the best way to do this would be a popup window with a cancel button and a "time remaining" indicator, but I am running into some problems with how to implement this. The VI is a state machine that needs to loop through several cases while the cancel window is being displayed. This has me hung up a bit. I can't make parallel loops because of the state machine structure.

So far, most of my VIs have been linear in nature. What is the typical way to branch off a VI like the popup window, which waits for input, but can also be closed by the main process when it is no longer needed?

I'd appreciate any tips or feedback.
0 Kudos
Message 1 of 3
(2,612 Views)

There are lots of ways to have VIs run in parallel and interact with each other.  The simplest thing you could do would be to use the Run VI method followed by the Open FP method in your main VI to launch the cancel dialog (with the "Wait Until Done" option set to False).  You could use a simple Global Variable to pass a boolean between the VIs as to whether or not they both need to terminate.

Of course, there are other ways to pass the data, like Queues, dynamic events, etc...but for your case, I think a simple global would suffice.

 

Message 2 of 3
(2,600 Views)
Thanks Darren,
I did it the way you suggested, with the Run VI method and the global variable and it worked great.

0 Kudos
Message 3 of 3
(2,573 Views)