LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Preserving Refnum Type

Solved!
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
(2,763 Views)

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

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 7
(2,740 Views)

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
(2,737 Views)

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?

 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 7
(2,730 Views)
Solution
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

Snap3.png

Make sure you save the extension as VIM.

 

Set up you VIM like so,

Snap4.png

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

Snap5.png

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

 

mcduff

Download All
Message 5 of 7
(2,716 Views)

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
(2,607 Views)

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.

 

mcduff

 

Snap1.png

0 Kudos
Message 7 of 7
(2,600 Views)