LabVIEW Shortcut Menu Plug-Ins

cancel
Showing results for 
Search instead for 
Did you mean: 

Create SubVI from Selected Wires.llb

Author: Darren (NI)

(inspired by this idea exchange post)

 

Note: This plugin is included in LabVIEW 2018 and later. You only need to download and install it from here if you are using LabVIEW 2017 or previous.

 

Select a set of wires. Popup on those wires and select "Create SubVI from Selected Wires" to make a new subVI that has the inputs and outputs of the wire types.

 

Before:

Untitled.png

After:

Untitled.png

Attachement is saved in LabVIEW 2015. For install instructions, go here.

Comments
X.
Trusted Enthusiast
Trusted Enthusiast
on

I guess this addresses this suggestion on the forum: Create SubVI from one or more selected wires

Darren
Proven Zealot
Proven Zealot
on

Thanks, I added a link in the description for the idea. We tried to put links to the idea exchange entries that inspired the plugins, but this one slipped through the cracks.

X.
Trusted Enthusiast
Trusted Enthusiast
on

I am wondering how difficult it would be to extend this to creating a VI from a simple selected function? The cherry on the cake would be to have the icon of the newly created VI use that of the function.

Oftentime, I find myself wanting to add some options to a primitive, and the required steps:

- take a snapshot of the primitive on the diagram

- connect function or encapsulate it into sequence structure

- Goto Edit>>Create SubVI

- Add the missing connectors

- edit the icon, paste the snapshot

seem to call for automation...

X.
Trusted Enthusiast
Trusted Enthusiast
on

There is one little problem with this shortcut.

In the illustration below, I want to insert a VI in the branch only:

Screen Shot 2015-11-15 at 18.53.39.png

but I obtain this:

Screen Shot 2015-11-15 at 18.54.04.png

The VI location corresponds to where the "Always Copy" intermediate object appears during the script, so the culprit seems to be where that object is located "by default".

Which is of course a general problem in LV (think probe location, broken wire "red cross" location, etc).

Hooovahh
Proven Zealot Proven Zealot
Proven Zealot
on

The insert function (using QD) had a similar issue in the 2012 era.  The insert method was modified to have another input which specifies the joint to insert it on.  I'm guessing this just isn't using the new input.

Darren
Proven Zealot
Proven Zealot
on

Yup, the plug-in wasn't using that new 'Insertion Point' input. Thankfully, the framework passes the mouse position in to each plugin, so the fix was very simple. I just updated the posted plug-in to fix the issue.

X.
Trusted Enthusiast
Trusted Enthusiast
on

One of the most useful potential application of this would be to handle broken wires better than currently, by providing the appropriate type in the created VIs (which would thus keep the broken wire in its diagram):

Currently, selecting the broken wire below and using the shortcut:

Screen Shot 2015-11-21 at 13.13.54.png

results in:

Screen Shot 2015-11-21 at 13.14.21.png

while I'd wish to get:

Screen Shot 2015-11-21 at 13.16.39.png

Contributors