LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modeless SubVI does not load

I need to open a SubVI  as a modeless dialog. My main application window displays a graph, and I am trying to pass a value to another SubVI that I try to open from the main windows. The problem I see is that when a set the properties of the SibVI as a dialog, I am able to open it. However, when I try to use the default or custom (floating) settings for the SubVI Windows Appearance, the window does not show up at all.

 

Any ideas?

0 Kudos
Message 1 of 51
(3,943 Views)

Make sure the Show front panel when called check box is checked. If that does not help, upload the VI or at least a screenshot of the dialog and the code.


___________________
Try to take over the world!
0 Kudos
Message 2 of 51
(3,939 Views)

I have the same issue with closing the SubVI.

 

 Here is the issue - once the form is closed using the X button, it will never be opened again. 

 

Try "Menu Selection Demo.vi" from the NI Example Finder

  • Run it.
  • Select any menu item, say "My New" menu item
  • Close it using the X button on the top right corner of the SubVI form (this will close it)
  • Select the same menu item again
  • The SubVI will not open.

Is there a way to disable the X button to prevent it from closing completely? Or something else should be used?

0 Kudos
Message 3 of 51
(3,925 Views)

Using the property node, you can open and close the fp of your VI.  I use this for opening dialogue boxes and info boxes.  I have closed this many times using the red X with no issues of it reopening.

 

open_close fp.png

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 4 of 51
(3,916 Views)

How will this work in run-time? A user might install the application to a different folder, so the location of the SubVI is unknown.

0 Kudos
Message 5 of 51
(3,912 Views)

You would make the path relative to the main VI - not hardcoded as in the example.

 

And regards your original question, look at the similar example called Menu Selection with Events. There, the subVI's 'X' button is disabled - VI Properties>Window Appearance>Customize. You can also use an event to correctly handle the 'X'.

0 Kudos
Message 6 of 51
(3,905 Views)

This is just a static file path I use on my dev system.  I know the path won't change and this is something that does not get distributed.  I only showed it as an example of opening and closing a fp using the property node.  You can make it dynamic, but with this, I have had no issues with the red X.  You can test it out using a static VI path to see if it works in your app first.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 7 of 51
(3,903 Views)

@Vladiator wrote:
Here is the issue - once the form is closed using the X button, it will never be opened again. 

In the case of the specific example you gave, this is basically a bug in the example, probably because whoever wrote it was focused on showing menu concept and not on polishing the UI behavior. The problem there is that you close the FP of the VI, but the VI itself keeps running. This means that the calling VI is now stuck because it's waiting for the subVI to finish running. Like Dennis said, you should either disable the button or handle it using the Panel Close (or, usually better, with the Panel Close?) event.


___________________
Try to take over the world!
0 Kudos
Message 8 of 51
(3,890 Views)

 


@tst wrote:
In the case of the specific example you gave, this is basically a bug in the example, probably because whoever wrote it was focused on showing menu concept and not on polishing the UI behavior. The problem there is that you close the FP of the VI, but the VI itself keeps running. This means that the calling VI is now stuck because it's waiting for the subVI to finish running. Like Dennis said, you should either disable the button or handle it using the Panel Close (or, usually better, with the Panel Close?) event.

Where do I find the FP.Close Event? It does not seem to exist in LV2009. The online description for FP.Close does not give any example (http://zone.ni.com/reference/en-XX/help/371361F-01/lvprop/vi_close_front_panel/)

0 Kudos
Message 9 of 51
(3,871 Views)

Well, I got the FP.Close event by selecting the VI Server Reference, then creating an Invoice Mode, connecting it to the VI Server Ref, and then selecting the Fron Panel Close event. Is this the right way? 

0 Kudos
Message 10 of 51
(3,861 Views)