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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reference of the subpanel caller from dynamic value change

Hello, I have a problem and I hope you can help me:

I have a Main VI with two subpanels, each subpanel is part of a cluster so I have Cluster1 with SubPanel1 and Cluster2 with SubPanel2.

I have a dynamic event registration for value change on all the variables of the SubVI1 and SubVI2, so when a value is changed I get the reference of the variable that changed.

My goal is to get the reference of the Cluster that contains the SubPanel with the variable that changed. I tried to use the "reference parent" propriety from the reference of the variable that is changed but then I get Class ID 31 (Panel) instead of ClassID 65 (subPanel) so I'm stuck and I cannot go "upper" from subPanel_i to the Cluster_i.

Anyone knows a trick to achieve what I want to do?

0 Kudos
Message 1 of 18
(3,581 Views)

Hello cassaniti,

a example really helps to better understand the behaviour you want. I attach one, which can be used as a base for your question, what you want to do.

Test.png

best regards
Alexander
Download All
0 Kudos
Message 2 of 18
(3,539 Views)

Hi and thanks for your will to help, unfortunately the VI you attached is made with LV2016 and I have the 2015.. can you save it as 2015 please? thanks!

0 Kudos
Message 3 of 18
(3,532 Views)

Hello cassaniti,

the main saved to 2015

best regards
Alexander
0 Kudos
Message 4 of 18
(3,531 Views)

The example you attached is similar to my goal but not exactly what I need. I upload a very very simple version of my goal. What I need to know is the name of the cluster where the value has changed (Cluster1 or Cluster2). I can go through the reference up to the panel name but not to the cluster where the panel is contained..

Download All
0 Kudos
Message 5 of 18
(3,520 Views)

Hello cassaniti,

 

thanks for the update now i understand what you want to do, but i also do not get the reference of the cluster, because there is no event registered so i get no information what cluster has a value change. A simple workaround give the controls different names an use the caption to show the same name on the frontpanel.

best regards
Alexander
0 Kudos
Message 6 of 18
(3,509 Views)

Good point but because the same VI is called on different subpanels and clusters, I can't change the name of the control.. Anyway my trick so far is to give to the subVI window title the name of my cluster so that I can read it afterwards.. dirty but it works!

0 Kudos
Message 7 of 18
(3,506 Views)

From the reference to the control, you can get a reference to the Owning VI.

From the SubPanels, you can get a reference to the Inserted VI.

Compare those VI references.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 8 of 18
(3,494 Views)

I thought you meant something like this, but it doesn't seem to work.. what am I doing wrong?

0 Kudos
Message 9 of 18
(3,478 Views)

Hello cassaniti,

 

a different architecture can also be a solution. Each SubVI has a ist own producer consumer architecture and if you want to transfer information from a SubVI to the MainVI you can send a message to the implemented queue in the MainVI with this architecture the Code for handling the events and all the controls must no be implemented in the MainVI only the consumer, which executes the messages has the code inside.

best regards
Alexander
0 Kudos
Message 10 of 18
(3,473 Views)