LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hide a Subvi from both Main VI and Subvi?

I have a Main VI that shows and hides subvis (and that works) but I don't know how to hide a subvi from within the subvi itself either using a button or with the File/Close or (X).  I can push a button on the main vi and have the subvi show up but I would like to be able to hide the subvi again either using the button on the main vi or somehow within the subvi.  I have attached what I have working so far.  Thanks for any help.
0 Kudos
Message 1 of 5
(3,126 Views)
Hi Nifty,
load you vi dynamically, use the "Open VI Referece" function. You can show or hide it with the property "FP.show" or with an invoke node.
 
Mike
0 Kudos
Message 2 of 5
(3,124 Views)
Thanks, and I will try (and try to learn about) your suggestions.

I have tried to "dynamically register" a "close window" event with an Event Structure and it would give an Error 1001 (vi is not open) 1/2 the time when I started the main vi, and would work 1/2 the time but sometimes would crash Labview.  But was the closest I have been able to come to what I want. 

Is there a way to hide the subvi with a button in the subvi and have the button in the main vi change with the differences in timing I have set up (50ms delay in the main Hide/show loop and 1000ms delay in the subvi)?

It looks like the "Open VI Reference" will have the subvi run only when it is called and I need them to run all the time, we just don't need to see the panel all the time.

I haven't used any of this Application Contorl yet so I'm looking for an easier soulution, but I understand that I may not be going about this in a good way.

Thanks again.


0 Kudos
Message 3 of 5
(3,099 Views)

Hi Nifty,

use the "Open VI Reference" function at startup (in your main vi), hide your vi frontpanel with one of the both options. You can show and hide it with a button now. I recommend to use an event structure to react on those button events. Store the vi reference in a shift register. Use the "Open VI Reference" function also in your subvi to get the own reference (you can also use the ready function). With another event structure there you can also hide this vi. To change the state of the button, you can use a queue to send commands or you use the control reference (you can get it from the vi reference and the property frontpanel).

Mike

0 Kudos
Message 4 of 5
(3,096 Views)
Again, thanks.  Looks like I have some learning to do.  But it will for sure make for a better program.
0 Kudos
Message 5 of 5
(3,094 Views)