LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reference to a Type definition

Solved!
Go to solution

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

 

 

 

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

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?

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

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.

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

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

0 Kudos
Message 4 of 7
(1,346 Views)
Solution
Accepted by topic author jojo1193

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:

Spoiler
FireFist-Redhawk_0-1605564091898.png

 

Should be straightforward but I can give you the modified code if you need it.

Redhawk
Test Engineer at Moog Inc.

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.

Message 5 of 7
(1,332 Views)

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 🙂

0 Kudos
Message 6 of 7
(1,313 Views)

Dear FireFist-Redhawk,

 

thank you very much your solution works very well 🙂

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