LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any way to know that whether a VI Ref has been inserted into (assigned to) a SubPanel?

Hi all, 

My question is "Is there any way to know that whether a VI Ref has been inserted into (assigned to) a SubPanel? ". 

Thanks for your kind help

Godel

0 Kudos
Message 1 of 7
(1,316 Views)

You can check if it's in a sub panel:

In SubPanel.png

Getting a reference to the subpanel a VI is in can be very, very hard.

0 Kudos
Message 2 of 7
(1,281 Views)

I'm not sure about the nature of your question -- are you referring to "Development Mode", where you want to know "What VIs are being used with this subPanel"?, or at Run-Time, "What is the RefNum of the VI that is currently running in the subPanel"?  I think I've asked (and answered, for myself) both interpretations of this question ...

 

Bob Schor

0 Kudos
Message 3 of 7
(1,268 Views)

@Bob_Schor wrote:

I'm not sure about the nature of your question -- are you referring to "Development Mode", where you want to know "What VIs are being used with this subPanel"?, or at Run-Time, "What is the RefNum of the VI that is currently running in the subPanel"?  I think I've asked (and answered, for myself) both interpretations of this question ...


I think the question is the reverse. Not "what VI is in my subpanel?" but "is my VI in a subpanel?".

 

Note that TPTB decided it's a terrible idea to give VIs a property to tell which subpanel it's in. Feel free to back me up here. You'd be the first.

0 Kudos
Message 4 of 7
(1,255 Views)

Thank you, Wiebe -- I did, indeed, assume the question was "what VI is in the subPanel".  I used a sub-Panel to display the Front Panel of multiple detached "Clones" that displayed, say, a particular Graph, and kept track of the RefNum (if I had 10 Clones, I'd have an array of 10 RefNums, and would know the index of the Clone being displayed).  In this situation, I could (of course) answer the reverse question, namely "Is Clone 3 being displayed?", just by asking for the index of the Clone being displayed, including having a value for "Nothing is currently in the subPanel".

 

Does this "roll-your-own solution" handle the concern you had about the VI not having the "Show My subPanel" property?

 

Bob Schor

0 Kudos
Message 5 of 7
(1,245 Views)

wiebe@CARYA wrote:

@Bob_Schor wrote:

I'm not sure about the nature of your question -- are you referring to "Development Mode", where you want to know "What VIs are being used with this subPanel"?, or at Run-Time, "What is the RefNum of the VI that is currently running in the subPanel"?  I think I've asked (and answered, for myself) both interpretations of this question ...


I think the question is the reverse. Not "what VI is in my subpanel?" but "is my VI in a subpanel?".

 

Note that TPTB decided it's a terrible idea to give VIs a property to tell which subpanel it's in. Feel free to back me up here. You'd be the first.


That was a fascinating read.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 7
(1,220 Views)

@billko wrote:

wiebe@CARYA wrote:

@Bob_Schor wrote:

I'm not sure about the nature of your question -- are you referring to "Development Mode", where you want to know "What VIs are being used with this subPanel"?, or at Run-Time, "What is the RefNum of the VI that is currently running in the subPanel"?  I think I've asked (and answered, for myself) both interpretations of this question ...


I think the question is the reverse. Not "what VI is in my subpanel?" but "is my VI in a subpanel?".

 

Note that TPTB decided it's a terrible idea to give VIs a property to tell which subpanel it's in. Feel free to back me up here. You'd be the first.


That was a fascinating read.


I can laugh about it now 😂.

0 Kudos
Message 7 of 7
(1,212 Views)