Showing results for 
Search instead for 
Did you mean: 

Preserving Refnum Type

Go to solution

I often need to enable or disable controls conditionally so I created a VI to do just that. My problem is that the type of the control refnum is lost this way. Is there some way to preserve the type?

Enable or Disable Control.png

0 Kudos
Message 1 of 7

Make a polymorphic VI (or whatever the 2018 equivalent is called) for all of the different types of control references. 

LabVIEW 2017
LabVIEW Programming
0 Kudos
Message 2 of 7

I realized moments after posting that I should have said, ". . . that doesn't require making a polymorphic VI for every type of control refnum".


So, is there any other way?

0 Kudos
Message 3 of 7

I don't think so.  How else can you change the output terminal to be a different reference type?

Malleable VI's may not work in this case.  I've never used them so I can't say for sure.

Do you really need the reference as an output?  Could you not branch the wire before the subVI?


LabVIEW 2017
LabVIEW Programming
0 Kudos
Message 4 of 7
Accepted by topic author auspex

You can do it by making two subVIs, a VIM and a normal subVI. For the VIM you need to set the VI properties correctly, like so


Make sure you save the extension as VIM.


Set up you VIM like so,


The subVI in the case structure is just what you had before,


You have to do it this way because the property node cannot be inlined.



Download All
Message 5 of 7

I was just able to test and this works.

However, I'm going to go back to just branching before sinking the ref in the VI because I can't put the VIM in my UI utilities packed library.

It bothers me that the refnum type isn't preserved like a class type with a dynamic terminal, but I imagine changing that would not be worth the massive effort.

0 Kudos
Message 6 of 7

Are VIMs not compatible with packed libraries? Sorry, I had no idea.


Below is the basically the same VIM except the wire is not branched, it goes through the subVI, you just need to add one more step.





0 Kudos
Message 7 of 7