Jump to content

Scripting functions for malleable VIs?


Recommended Posts

Posted

Has anyone found any properties or methods associated with malleable VIs? Specifically, I was hoping to find a way to invoke the "Convert Instance VI to Standard VI" function after confirming that a selected VI was indeed malleable. LabVIEW reports the class type of a selected malleable VI on the block diagram as a standard Sub VI, and I didn't see any properties/methods under the VI class.

 

I'm exploring what it would look like to make a utility to convert a malleable VI into a polymorphic VI for the purpose of backwards compatibility. I'd like to have a reference library that uses malleable VIs but create a version that is still accessible to someone using older versions of LabVIEW that don't officially support malleables. 

Posted

I couldn't find a method for "Convert Instance VI to Standard VI" as you can from the right-click menu but it looks like if you get the VI reference from the subVI you get a reference to the instance VI so you could potentially just copy the block diagram and put it into new VI (reconnecting the terminals might take some work).

I'm not sure what the best way would be to figure out whether the subVI is a VIM. If you grab the subVI reference and try to pull the VI Path you just get <not a path> and the VI name returns some crazy UID.

  • Like 1
Posted
2 hours ago, jacobson said:

I'm not sure what the best way would be to figure out whether the subVI is a VIM.

It may surprise you that this is the best way:

1.png

  • Like 1
Posted
1 hour ago, Darren said:

It may surprise you that this is the best way:

1.png

It does surprise me. I would have thought an entry for VI Type would have been added to the enum.

Posted
19 minutes ago, ShaunR said:

It does surprise me. I would have thought an entry for VI Type would have been added to the enum.

Yeah, I think the explanation given to me was that the contents of the .vim file on disk are no different than the contents of a .vi file on disk. So since it's technically not a different file type, they thought it didn't warrant a new enum entry. Kinda like how there's not a "Template VI" entry in the list since .vi and .vit are the same type on disk. I may be misremembering though so don't take this as the official answer.

Posted
3 hours ago, Darren said:

It may surprise you that this is the best way:

1.png

Huh. Yeah, I didn't expect this. Doesn't this suppose that the user hasn't changed the displayed label text for the subVI?

Posted
51 minutes ago, the_mitten said:

Huh. Yeah, I didn't expect this. Doesn't this suppose that the user hasn't changed the displayed label text for the subVI?

It's impossible to change the label text of a subVI. That's why this works.

Posted
On 8/6/2018 at 6:33 PM, Darren said:

It's impossible to change the label text of a subVI. That's why this works.

Interesting! Didn't realize that. Thank you!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.