From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
12-29-2021 02:25 AM
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
12-29-2021 10:33 AM
You can check if it's in a sub panel:
Getting a reference to the subpanel a VI is in can be very, very hard.
12-29-2021 02:01 PM
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
12-30-2021 06:09 AM
@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.
12-30-2021 12:46 PM
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
12-30-2021 11:54 PM
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.
12-31-2021 06:36 AM
@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 😂.