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: 

Can't get top-level VI ref from subpanel VI

Solved!
Go to solution

I'm manipulating a control on the front panel of a VI in a subpanel. The "CvtPaneToPanelCoords" method returns a value in the coordinate system of the top-level VI that owns the subpanel. I need to use the "CvtPanelToScreenCoords" method on that value, but I can't get a reference to the top-level VI's panel. When I use the Call Chain primitive to find the top-level VI, the last item in the list is

 

My Class:Subpanel VI.ACBRProxyCaller.5AE00058

Trying to open a reference to that name, I get error 1004 (The VI is not in memory).

 

The ACBRProxyCaller is used by the Asynchronous Call By Reference node, isn't it? Am I running into some aspect of the subpanel's implementation? How can I get a reference to the VI that owns the subpanel my VI is inserted in? And more specifically -- because I'm actually nesting subpanels within subpanels -- how do I get a reference to the front panel of the top-most VI (the one that owns the highest-level subpanel)?

0 Kudos
Message 1 of 4
(4,708 Views)
Solution
Accepted by topic author David_Staab

The call chain primitive only works for subVIs. An ACBR call is not like calling a subVI, so that doesn't work.

 

The basic answer to your question is to pass the reference into the VI yourself. If you have some more involved logic you might need to have something like an action engine to keep the correct reference(s).

 

 


___________________
Try to take over the world!
0 Kudos
Message 2 of 4
(4,691 Views)

Right, I'm (mostly) aware of the nuances of using an ACBR to launch a VI. But from the perspective of my programming interface, I'm statically launching the subpanel VI. I'd like clarification on whether or not that's true. It seems like the "Insert VI" method uses the ACBR API under the hood to dynamically launch the subVI.

 

Passing the owner's refnum into the VI is workable, but it really clutters up the API I'm developing. 😞

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

@David_Staab wrote:


It seems like the "Insert VI" method uses the ACBR API under the hood to dynamically launch the subVI.


Insert VI doesn't launch anything. It takes the FP of the VI you give it and displays it in the subpanel.

 

If your subVI call is really static, I would suggest simply calling it as a subVI and using a static VI reference to give its reference to the subpanel. I did this many times and it works very well.

 


___________________
Try to take over the world!
0 Kudos
Message 4 of 4
(4,662 Views)