LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I get the reference of the vi running(loaded) in a subpanel?

Hello,

I am trying to get the reference of a control in a vi loaded in a subpanel.  Usually I would get the reference of the vi and from that the reference to the control I want.  However I cannot find a way to get the ref to the vi loaded from the subpanel methods.  Obviously I know that I can save the reference to the subpanel-vi in the vi holding the subpanel, and go along with it.  However I would prefer to access the ref directly from the subpanel methods/properties so that I dont have to write the code to keep track of what I am loading or unloading in the subpanel especially because I am having clones vi loaded in.  Is there anyway to do it? Thanks in advance for any help.

0 Kudos
Message 1 of 11
(2,799 Views)
0 Kudos
Message 2 of 11
(2,779 Views)

Thanks!

0 Kudos
Message 3 of 11
(2,778 Views)

Actually I found that there was an error in the posted solution that was hanging my more complex main, the correction is attached

0 Kudos
Message 4 of 11
(2,755 Views)

sorry there were still some bugs in the previous control, I guess I got them out of the way and made it a little more usable.

you can also push and pop the subpanel vi in and out of the subpanel....  And you can implement a custom menu on the subpanel to integrate such funcionality into your code (standard subpanel have inaccessible menus as far as I tried).

0 Kudos
Message 5 of 11
(2,701 Views)

If you don't have a VI reference, how do you put the VI into the subpanel in the first place?

 

What exactly is this xcontrol supposed to do?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 11
(2,697 Views)

From your reply I guess my question was not clear;  lets say that:  1-I open a vi reference using a path, 2-throw the reference to the subpanel, 3-run or do whatever....       ....after some time I want to get some data from the subpanel loaded vi. Now if I don't keep a local variable or some register with the ref to the vi loaded in the subpanel, I cannot get such reference from the subpanel itself (and this might be a problem if you have loaded the subpanel programmatically.. ).  

The xcontrol I posted do exactly this: will get you back the vi ref loaded in the subpanel without the need to keep track of what you have loaded.  Moreover I can implement menus on it now, something I canot do with the 'standard' subpanel.

Hope that helps 

0 Kudos
Message 7 of 11
(2,692 Views)

If you insert the VI reference into the subpanel and then can't go back and use it later, that seems like a problem with how your program is designed.

 

I don't know what you mean about implementing menus, I implement menus on VIs that are in subpanels all the time...

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 8 of 11
(2,685 Views)

Mike, I guess the attachment may help better than explaining

0 Kudos
Message 9 of 11
(2,679 Views)

Ok, I think you may have a basic misunderstanding of what a subpanel is for. The whole idea of it is to display the front panel of another VI that is running in parallel with the VI containing the subpanel. As such, the VI that is being shown in the subpanel should be designed to handle all its own menus, and most everything else for that matter.

 

The purpose of the VI containing the subpanel is to manage the insertion of other VIs in its subpanel, and perhaps provide some common resources that all the VIs going into the subpanel might need, like a systematic way to shutdown the application as a whole, a common menubar, or perhaps some front panel buttons that the subpanel VIs could use.

 

You don't need anything as complicated (or as potentially troublesome) as an XControl.

 

Mike...

 

PS: In terms of getting a reference to the inserted VI, how about the "InsertedVI" property...

 


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 10 of 11
(2,671 Views)