LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I close a running .vit using the X button without getting the save VI dialog?

One solution is to save the running .vit instance to disk before the operator is able to use the X button to close the running VI. This is awkward as I don't need another numerically named copy of the .vit on my disk. Adding a "Quit" button to my .vit front panel is also an option but it would be nice to be able to use the X button instead.
0 Kudos
Message 1 of 5
(2,570 Views)
Maybe I don't quite understand your reasoning, but I don't think a *.vit is intended to be run at all. It is just a template to quickly create a new VI with certain design elements. It is a development tool.

You should probably save whatever you made as a plain VI before running. Could you clarify what you are trying to do?
0 Kudos
Message 2 of 5
(2,567 Views)
By "a running .vit" I mean a .vit VI dynamically launched using the VI Server.
0 Kudos
Message 3 of 5
(2,563 Views)
If you have LabVIEW 6.1 or higher, you can use the Event Structure to capture the click of the 'X' button, and choose to ignore it and close the panel.

Configure an Event Case to "This VI..Panel Close?" filter event. (note the question mark) On the right side of this new case, there will be a boolean terminal that will let you discard the event. Open a reference to the VIT and pass this out of the main loop, and use a property node on this reference to close the front panel, then close the reference.

It will go away when you hit the 'X' without prompting to save.

A simple example is attached. You'll either need ot make a change or copy everything to a new VI and run that to prove it doesn't prompt for saving changes. This is in 7.1, Let me know if you need it in an earlier version.

Ed

Message Edited by Ed Dickens on 03-03-2005 12:58 PM



Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 4 of 5
(2,553 Views)
Thanks Ed. That's a bingo!
0 Kudos
Message 5 of 5
(2,538 Views)