Jump to content

Closing vi and sub vi's by using a Method


Recommended Posts

Hi folks,

Just a question related to an vi, which calls at the same time other vi's. The case is that I'd like to close Labview when the main vi finishes its execution so for this purpose I use "Quit Labview" vi under Application Control palette.

At this point when Labview tries to close itself it is going to ask you if you want to save not only the vi but also the sub vi's so how can I manage to say Labview that I don

Link to comment

Hi Jose,

Well I can tell you why the code you posted is not going to work. The "Save a Copy" property on the invoke node is for saving a copy to a new file name, and it is defaulted to false anyway. I am still a beginner, but I would think the best way would be to call your sub VIs using a Call By Reference Node and to use a Close Reference VI to close it before executing the Quit VI. When you close the reference to the sub VI it will not prompt you for saving changes. Take a look at the "Dynamic Load Example.vi" that ships with LabVIEW.

John Ridpath

Link to comment
Hi,

are you speaking about closing dynamic or static SubVIs?

If you are speaking about dynamic subVIs, then do as John suggested, i.e. call the "Close VI reference" on all opened references, but do it after you have closed all open frontpanels. If you don't close the front panels first, the VIs will stay in memory, causing the save dialog to appear when your application exits.

Then the question is why you don't want to save these VIs? A VI that contains changes are loaded with FrontPanel/BlockDiagram and are then recompiled, i.e. consumes much more memory and takes longer to load. If you have many VIs with changes, the main VI loads much slower.

/J

As you are running from the Development Environment, you may want to ask yourself: is the end user also running from the Development Environment or are they going to be running from an EXE? If the answer is EXE, you shouldn't really have to care bc the dialogs will not appear. If you are going to be running from the development environment, an easy way to prevent the dialogs is to make all of your VIs 'Read Only' AND set the LabVIEW Options to "Treat Read Only VIs as Locked" And "Do not save automatic changes" to checked.

post-5746-1167238025.png?width=400

Link to comment
If you are going to be running from the development environment, an easy way to prevent the dialogs is to make all of your VIs 'Read Only' AND set the LabVIEW Options to "Treat Read Only VIs as Locked" And "Do not save automatic changes" to checked.

Good point, you are right that this is the easiest way.

But, you would have to accept the same settings for all VIs/projects, and you must also take into account that moving between computers also involves setting the right checkboxes in the LabVIEW options.

I still feel that the main question is why the save-dialog should be supressed at all?

/J

Link to comment

Hi all of you and thanks for your feedback,

sorry for the delay, you know special days. Related to my post I have things to add, maybe my first one was a little bit caotic :thumbdown: , anyway my main vi, which includes several sub vi's will be an application(.exe file) which:

1. It'll be launched by Windows at night.

2. This vi will perform some tasks.

3. and it'll close automatically. (Quit Labview vi)

at this point I don

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.