From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need example of ....

Help!  I need to see an example of a main vi that

1. Calls a subvi and opens it's front panel
2. The subvi has on its front panel a button to hide it's front panel
3  The main vi has a button to unhide the subvi's front panel

Thanks
LV 8.6 on Windoze XP
0 Kudos
Message 1 of 9
(2,951 Views)

Hello Clueless,

Although I do not have an example, here's some information to get you started:

1. Calls a subvi and opens it's front panel

How Can I Control Whether or Not The Front Panel of a SubVI Pops Up When Called in LabVIEW?

2. The subvi has on its front panel a button to hide it's front panel
3  The main vi has a button to unhide the subvi's front panel

As far as numbers 2 & 3, what exactly do you mean by hide?  Do you want to minimize the subVI's front panel?  Do you want to bring some front panels to the front while pushing others to the back?  Do you actually want to close and reopen the front panel?  Will you ever want to hide the main VI?

Good luck!

Janell R | Applications Engineer

0 Kudos
Message 2 of 9
(2,911 Views)
Here is an example I wrote a while back for another question on this forum.  It is not exactly what you want, but you should study how it works.  It uses property nodes and references to control buttons, indicators, and front panels of sub-vi's.  Start with this and you can modify it to do what you want.  If you run into a snag, ask more questions.  But try to do this on your own first.
- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 9
(2,903 Views)
I want to keep the subvi panel (child) process alive, but make the panel invisible by pressing a button (OK) --think dialog box.  I want to have a button on the parent panel that makes the child process's front panel visable.  Is there a way to spawn a subvi, and get a reference handle to the child process?  I think this is what I want to have and then I can twidle the child's properties from the parent process?  Am I making any sense?

Thanks
LV 8.6 on Windoze XP
0 Kudos
Message 4 of 9
(2,903 Views)
Open the subvi dynamically as shown in my Main.vi code.  Use the FP.Open property as shown in my Main.vi code.  Use a boolean control wired to the FP.Open property.  The code on how to open a subvi and run it, and show/hide the subvi front panel is all shown in my Main vi code.  Adapt it for your use.  Instead of me writing the entire code for you, you should learn how this works so that you can create it yourself.
- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 9
(2,897 Views)
Hey Tbob.  This looks like what I'm asking for.  Is there any way to retain access to the child processes front panel controls and indicators?

Is there a way I can specify the subvi path so that it is scoped to the parent lvlib or do I have to wade into the NTFS namespace?
LV 8.6 on Windoze XP
0 Kudos
Message 6 of 9
(2,896 Views)

Once the subvi is opened dynamically, you can use the reference output from the Open VI Reference output throughout your vi to control any subvi front panel object.  Just wire this reference into any property node to control subvi front panel objects or to read indicators. 

You can specify the subvi path using a path control or path constant.  You can write in the entire path, or you can get the main vi path and add the sub directories using build path if the sub is under the main's path.  My example shows a control that has the subvi path.  You could use the function that returns the current vi path, and use the Build Path function to add the rest of the subvi's path relative to the main vi's path.  Study the functions for Build Path and Current VI's Path.

- tbob

Inventor of the WORM Global
0 Kudos
Message 7 of 9
(2,891 Views)
I know this is a bit off the original subject, but is there a way to do something that works like specifying a LIBRARY_PATH environment variable, or explicitly naming a library path as a compiler/linker option  when linking C code?  That is, is there a way I can KNOW FOR SURE where I'm linking to, other than explicitly building each and every vi path?  It seems like the lvlib and lvproj kind of does this, but there are fall through's that allow linking to who knows what.  Is there a way to enforce strict control? 

Also, is there anything I can do when things get hosed up, and I find myself linking to stuff all over the filesystem, because LV was not able to find the a vi where it was supposed to be, and so LV linked to whatever it could find?  Do you know what I mean?


Thanks,

LV 8.6 on Windoze XP
0 Kudos
Message 8 of 9
(2,869 Views)
Organization is important in LV because if it can't find a vi where it is supposed to be, LV will search through a list of paths to find the vi.  I think that list is defined in one of the headings of Vi Options.  Look under Tools Menu - Options - Paths - VI Search paths.  Uncheck the Use default box and edit your own list.
- tbob

Inventor of the WORM Global
0 Kudos
Message 9 of 9
(2,854 Views)