ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bug with VI Template (.vit) behavior with express VI's in LV8.6.

Hello,

 

I have an application that was originally coded in LabVIEW 8.0, Windows XP.  One part of the program utilizes a VI template (.vit) to open multiple instances of a subVI for the user.  In versions prior to 8.6, when the VI was called via the VI server and then closed pragmatically, it did not spawn a "Save Changes..." dialog.  Upon upgrading the application from LabVIEW 8.5 to 8.6.1 the "Save VI..." dialog shows up when the .vit subVI's are closed.  After investigating the behavior, I have determined that inclusion of Express VI's (I haven't tested them all, but I've tested several) cause the "Save VI..." dialog to open when closing the .vit pragmatically.  What's interesting is that it exhibits this aberrant behavior even if the express VI is in the disabled pane of the diagram disable function.  (I thought that's supposed to remove the code from compilation completely?).

 

I've attached an example program that illustrates the behavior.  Run "Call Template.vi". Select either the subVI with or without the express VI in the diagram disable function.  Note that when closing the VI via the "stop" button with the express function the "Save Changes..." dialog opens and it does not with the express VI absent.  I have only seen this behavior since upgrading to LabVIEW 8.6.1.

 

My only current workaround is to remove all express VI's from my application.  Luckily this has been possible however I have had to use the "File Dialog" compatibility primitive (instead of the express VI file dialog) which claims not to be supported.  It took a while to find that function: I had to find an old program and copy the vi.

 

Any other suggestions on fixing this issue?

 

 

0 Kudos
Message 1 of 13
(3,885 Views)

If you've got an event structure in the vit, you could catch the Application Instance Close Event and use the silent shutdown terminal.

 

Felix 

Message 2 of 13
(3,865 Views)

F. Schube,

 

Excellent idea however there are a couple reasons this wouldn't work:

 

1) I want the user to be able to close a sub-window without having to terminate the entire Application Instance.  There are other VI's running in the same instance that can't be closed.  So I can't really use this event.

 

2)  For strictly academic reasons, I coded it up to see if it would work.  Even with Silent Shutdown wired as true, you still get the "Save Changes..." dialog when the event fires.  (It turns out the best way to get the event to fire is killing LabVIEW with the task manager.)  I've attached the modified example.

 

 

 

 

Message 3 of 13
(3,848 Views)

Didn't take a look at your code before. You need the option 0x08 (reentrent execution) on the Open VI Reference function to run the template, otherwise you generate a new vi from that template.

 

Hope that's it, I can't test it.

 

Felix

Message 4 of 13
(3,857 Views)

The subVI is not reentrant, so setting the 08h code causes an error and it wont load.  I'm not calling the subVI via the "call by reference" node.  I'm using just the plain methods and properties.  I've attached a screenshot of "Call Template.vi".

 

 

Message Edited by Chris Immer on 05-06-2009 04:40 PM
Message 5 of 13
(3,838 Views)

Hi Chris,

 

Why are you trying to execute templates.   As you can read in the LabVIEW Help templates are for getting started building common applications.  Templates are not meant to be executed.  

 

The expected behavior for what you are doing is that you should be prompted to save both VIs.  When you execute your code it creates a new VI.  Notice that the menu bar has the title of the template followed by a number.  That is the name of the new VI that was created from the template.   

 

If you save the VI that is created and then run your application with that VI you are not prompted to save it.  I would suggest not using templates, but use VIs.

 

Best Regards,
Bryan H.
Message 6 of 13
(3,829 Views)

I am never sure when this comes into effect but try checking...

 

Options >>> Environment >>> Trreat read-only VIs as locked

 

and

 

Options >>> Environment >>> Do not save automatic changes

 

 

The first enables the second and the second will inhibit the save that triggers the Save dialog (under some circumstance).

 

Just trying to help,

 

Ben 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 13
(3,798 Views)

Brian H./Hesloppy,

 

I'm not sure why I need to explain this to an NI employee, but it would behoove you to familiarize yourself with your company's product:

 

http://digital.ni.com/public.nsf/allkb/98847B4E4C715E6D86256C59006B57CC

 

http://zone.ni.com/devzone/cda/tut/p/id/3095

 

It will also help you to understand the problem by running the code that I posted to see how this behavior works.  It is only when express vi's are in the program that causes the proper behavior to break. It's especially disturbing that the express VI in the diagram disabled function breaks the proper behavior.

 

Reentrant VI's are not really intended to have a front panel.  It's only in the last few versions(maybe 8.2?) that the front panel was even accessible for reentrant VI's while running.  VI templates are the proper way to have cloned user interface front panels.

 

 

0 Kudos
Message 8 of 13
(3,783 Views)

Ben,

 

Thanks for the suggestion.  I would have never thought to look at these options.  Unfortunately, I set the options and it didn't seem to help.  I still get the the "Save Changes..." dialog with express VI's in the .vit.

 

 

Message Edited by Chris Immer on 05-07-2009 11:16 AM
0 Kudos
Message 9 of 13
(3,780 Views)
0 Kudos
Message 10 of 13
(3,775 Views)