LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Script to Insert Code in Wire

Solved!
Go to solution

I am trying to create a script to insert code in a VI.  The code to be inserted looks like this:

s1.png Manually I can do this by putting this code in a subVI, right-clicking on the wire in the VI to be edited and select Insert -> -> Select a VI... , then right-clicking on the new subVI and selecting "Replace with subVI Contents".  But apparently there's no way to script that.

I can't leave it as a subVI because the actual class is not always the same.  I can't make it as a malleable because class unbundlers are not allowed in malleables.

So far, the cleanest way I can think of is to have this in a template:

s2.png Copy and paste it into the target VI, then write a bunch of script to hook it up and then remove the sequence.

Can anyone think of a better way?

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 1 of 3
(1,495 Views)
Solution
Accepted by topic author paul_cardinale

SubVI has a 'inline' method that does this.

 

The name was probable created long before VI's could actually be inlined.

 

Inline SubVI.png

0 Kudos
Message 2 of 3
(1,434 Views)

wiebe@CARYA wrote:

SubVI has a 'inline' method that does this.

 

The name was probable created long before VI's could actually be inlined.

 

Inline SubVI.png


Thank you.  Part of my code went from this:

ss1.png

to this:

ss2.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 3 of 3
(1,419 Views)