LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically loading sub vi's front panel

Hey all,

 

How can I dynamically load sub VI's front panel's into sub panels on a tab control based on a predetermined condition?

 

I also have another question but I will paint you a picture of my program before I ask (I also posted it). Basically my program is setup with third party drivers to work with some of my companies hardware. My program is based on what hardware is connected and automatically goes out, finds it and connects to it. There are 4 types of hardware, ES410, ES411, ES420 and ES441. I would like to have support for up to 8 of each of these types of hardware. I've already laid the framework for this down, however I need to know one thing. 

 

How can I load the same VI's front panel multiple times but have a seperate instance controlling different hardware?

 

For instance if there is two or more of the same type of device connected. The front panel for both devices is excatly the same. I've already set it up. But how can I load two seperate instances of that VI that each controls there own designated hardware device?

 

Thanks

 

-Brad

0 Kudos
Message 1 of 4
(3,112 Views)

Hi Brad,

you can use vit (vi templates) to do it. Create a vit from your vi and load it dynamically as often as you need it. You will get a new instance for every call. 

 

Mike 

Message Edited by MikeS81 on 09-03-2008 10:33 PM
Message 2 of 4
(3,111 Views)

Thanks Mike. I have another question though.

 

How can I obtain a reference to that .vit that each one with load into specifically the right subpanel. For instance I want the first ES420, to load the first instance of the VI's front panel into the ES420_1 tab in a sub panel, and I want the second instance of the VI's front panel for the ES420 to load into the ES420_2 tab in a sub panel? How can I explicitly link these together?

 

Thanks

 

-Brad

0 Kudos
Message 3 of 4
(3,081 Views)

Hi Brad,

you can use a for loop to create the number of instance you need. You can also create references from your sub panel instead of the property nodes you get automatically. If you vi instance run, you will have a array of references. Create also an array of references from you sub panel references and go through another loop to show the vi in the specified sub panel. It should also be possible to only use one for loop. Smiley Wink

 

See the attached example, it´s the one loop solution. 

 

Hope it helps.

Mike

Message 4 of 4
(3,066 Views)