LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Proper Method for closing a VI?

Hi there,
I am a very inexperienced labview user, so this question may be a walk in the park for you pros. What is the proper method for closing a VI? I want a particular VI to close upon a certain occurence. When I use a property node to close the front panel, then an invoke node to abort the VI with a static reference. I sometimes get a message dialog in the upper left corner of the screen that says "Resetting VI: [Vi's name].vi" at which point labview freezes, and must be closed externally from the Windows task manager. I know that using the "abort" can leave certain references open, so I close these references upon completion of every cycle... What is the proper method of closing a VI?
Thanks a bunch,
Ryan
0 Kudos
Message 1 of 6
(3,333 Views)
Hello,

Why don't you use the "quit labview"?
Software developer
www.mcm-electronics.com





PORTUGAL
0 Kudos
Message 2 of 6
(3,329 Views)
Hello,

I've forget to attach a picture that help you indentify the function.
Software developer
www.mcm-electronics.com





PORTUGAL
Message 3 of 6
(3,331 Views)

If he is calling the VI from another VI then the quit LV will shutdown everything including the main VI.

 

Please post what you have already tried.




Joe.
"NOTHING IS EVER EASY"
Message 4 of 6
(3,319 Views)

Hi Ryan,

The correct method for closing your VI is dependent on how you have chosen to open it.  Like Jhoskins, I think the LabVIEW community will better be able to assist you if you post what you've already tried.

If you have tried to dynamically load your VI using a Call by Reference Node, you will need to use an Open VI Reference and a Close Reference.  Please take a look at the Dynamic Load Example from the NI Example Finder.  You can find this by searching for VI Server in the Example Finder. 

I have attached a figure that shows this Open, Run, Close paradigm in the Dynamic Load Example.


Message Edited by cphuong on 04-17-2007 10:43 AM

Regards,
Ching P.
DAQ and Academic Hardware R&D
National Instruments
Message 5 of 6
(3,288 Views)
Thanks for your helpful advice.
I couldn't use the "Exit LabView" VI because I only wanted a particular VI in the application to shutdown on a particular occurence, but I have used that VI before as applications "END" feature, and it works pretty well. In the end, I ended up doing something that I think is pretty sloppy but works... I made a static reference to the particular VI who's closing event would be the trigger, and I bascially wired it so that if the front panel of this partcular VI was closed, then the dependant VI should close it's front panel and abort as well. I know it's sloppy, but it works well and consistenly; this makes me happy. Ha ha! really though, I always get good advice on this forum and I do appreciate it.
Ryan
0 Kudos
Message 6 of 6
(3,248 Views)