11-16-2020 09:11 AM
Hello together,
in my main VI i have different clusters. These clusters are defined as a tryp definition.
In my subvi I want to change the colour of an element of a cluster.
Until now i habe a Reference as an Control Element in the SubVI. The Main VI forwards the reference of the cluster to the SubVI. This works fine. But if i change the Typdefinition i get an error of the subVI because of the wrong reference. (The reference dont update automatically).
Do you have a solution to fix this? Maybee something like to tie the reference to the Type definiton?
Many thanks in advance,
Johannes
Solved! Go to Solution.
11-16-2020 09:18 AM
This is the kind of question that needs some code attached so we can see what you are doing.
Are you working with a regular type definition or a strict type definition?
11-16-2020 10:06 AM
I am not allowed to post the code but i created an example. If you change the TypeDefintion "MainVI-Cluster" the Code dont work anymore. (I create also a Cluster a little bit different so that you can see the problem without changing anything). I hope that you can understand my problem.
11-16-2020 12:26 PM
Your sub-VI needs to be able to take two distinct types of input, "Cluster" and "Cluster-Error". There are a number of ways to write a VI that is sufficiently "malleable" to do this -- you might look into "Malleable VIs", which have the extension ".vim".
Bob Schor
11-16-2020 04:03 PM
1. On your Reference Control of your SubVI, upcast it to the more generic Control class by right clicking it and "Select VI Server Class" > Generic > GObject > Control > Control.
2. Drop a "To More Specific Class" Node and wire it as shown:
Should be straightforward but I can give you the modified code if you need it.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
11-17-2020 02:47 AM
Dear Bob_schor,
first thanks for your answer. I tried your solution but it didnt work. After a quick research i found the information, that property nodes arent allowed in Malleable VIs (https://www.mediamongrels.com/introduction-to-malleable-vis-labview/).
But nevertheless thank you i didnt know that such VIs exist. This will help me with other projects 🙂
11-17-2020 02:48 AM