02-22-2017 01:53 AM
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?
02-23-2017 06:15 AM - edited 02-23-2017 06:17 AM
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.
02-23-2017 09:09 AM
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!
02-23-2017 09:13 AM
02-24-2017 01:22 AM
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..
02-24-2017 05:49 AM
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.
02-24-2017 05:51 AM
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!
02-24-2017 03:57 PM
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.
02-27-2017 01:09 AM
I thought you meant something like this, but it doesn't seem to work.. what am I doing wrong?
02-27-2017 02:18 AM - edited 02-27-2017 02:19 AM
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.