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:
After:
Attachement is saved in LabVIEW 2015. For install instructions, go here.
I guess this addresses this suggestion on the forum: Create SubVI from one or more selected wires
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.
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...
There is one little problem with this shortcut.
In the illustration below, I want to insert a VI in the branch only:
but I obtain this:
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).
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
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.
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:
results in:
while I'd wish to get: