Thus, no need to add the "EXIT" VI, and no need to check if the VI is in Run-Time mode or developpement mode...
(for big application, it could be when no VI are running...)
For example, add an option in the application builder :
>> Close the run-time engine when the application is completed...
This has already been suggested - http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Add-an-easily-accessible-way-to-close-an-application/i...
(see the comments there).
I checked but didn't find it...
I rate your post.
I don't really see why this is necessary? LabVIEW already exits completely when all VIs finish running...
The 'Quit LabVIEW' primitive is usually not a very good way to shut down an application.
@Steen - when you are run a compiled executable it does not close the exe on completion.
The correct way is to close the front panel of your VI when it is cleaning up. If the front panel isn't open, the the VI will exit memory when it is done running. Once all VIs are out of memory, the application will close and the RTE will shut down. This is a coding issue, not a settings issue.
>...LabVIEW already exits completely when all VIs finish running...
Quite incorrect. When your VIs finish running, the FP just sits there waiting for you to run it again. As Tim pointed out, to get it to fully shut down:
> The correct way is to close the front panel of your VI when it is cleaning up...
But why would that be "the correct way"? I know it works, but you do realize that that's fairly arbitrary, right? It certainly doesn't seem to make much sense to me, not to mention the minor problem that if there's no open FP, the run-time will terminate automatically even if that's not what you want (I haven't tested this in a long time, but I think that's still the case. If I remember correctly, in the cases where I did need something like that, I had to set the window state to hidden).
I personally think that closing at the end of the execution is much more natural and easy to understand and I don't really see the point of leaving the app open. Like I said in the other idea, I agree that there probably should be a check box in the build settings (in case someone does want the current behavior for some reason), but its default value should be to shut down the app.
Yeah, this is an idea I could get behind. I build an application last week (It was only a small test program) and guess what... The FP stayed open when finished because I forgot to close the FP when finished.
This is a small point which can cause awkward moments if you're showing your code to someone sand they ask why the finished program is still visible. I can't think if a single use case I've come accress where I wanted the program to remain visible after finishing. It's just another quirk from LV we've come to accept. That doesn't make it right.
I found some comments that indicate that the reason that the RTE stays open is because it is available to be run through VI Server -- perhaps someone long ago designed it so that you would build an app, call it remotely, then ask it to run again with the same reference.
I have no idea if this is the reason for the design. Is that functionality useful commonly? Probably not. Seems like we could add this option (autoclose all VI windows when all VIs are idle) for new build specifications and upgrade existing build specifications with the option turned off, just to avoid breaking anyone's code.
I'll throw my kudos behind this and let the implementers worry about the details.
AQ, you might want to vote for the other idea - http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Add-an-easily-accessible-way-to-close-an-application/i...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.