LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
X.

Adding Input (or Ouputs) to a subVI from a calling VI

Status: New

This idea is all about culling clicks.

Example:

 

I have created a subVI based on another VI and I realized that I needed some additional input from the calling VI to perform the task within the subVI:

 

ScreenHunter_001.jpg

 

Since I want to get the right data structure, I can't really create a Control within the subVI, add it to the connector pane and connect the corresponding data from the calling VI.

So I need to:

 

1) Go to the calling VI

2) Drop a dummy Sequence structure on the BD

3) Pull a wire from the data structure I want to connect to the subVI and connect it to the dummy Sequence

4) Create a subVI from that sequence

5) Copy the resulting control on the subVI's panel

6) Destroy the temporary subVI (that involves a "Do you want to Save this VI?" dialog, so it is really a two-step process)

7) Go to the target subVI

😎 Paste the Control

9) Connect the control to the Connector Pane

10) Go back to the main VI and connect the data

 

What I suggest is to replace all these steps by a 2-step process:

 

1) Pull a wire from the data source

2) Bring that wire OVER the target subVI and by a magic combination of keypress and mouse click (for instance "I" for "Insert" and a Right-Click), open up a dialog allowing me to connect that wire into an available connector on the target subVI (a Control being created in the process - I am fine with having to convert it to an Indicator later).

Basically, this "action" would provide access to the connector pane of the subVI with an automatic creation of a control upon clicking on the connector. Existing rules for Control name generation would be fine.

 

Something like that:

 

ScreenHunter_003.jpg

 

The interface could switch from the subVI icon view to the connector pane view, for instance.

 

I find myself wanting this alot for things as simple as passing a Graph reference to a subVI, where I want the reference to correspond exactly to the graph type.

 

10 Comments
X.
Trusted Enthusiast
Trusted Enthusiast

Actually the process I describe has a few more than 10 steps (as you need to remove the temp subVI from the original diagram)...

Another possible alternative is not that much quicker: instead of creating a subVI, you can create a Control. However, I tend to avoid that as it usually messes up the FP (especially if you have tabs) and I end up wasting time to recenter the VI in its intended bounds.

RavensFan
Knight of NI

I don't understand what you are looking to do here, and I don't understand your statement "Since I want to get the right data structure, I can't really create a Control ".  Why not?

 

What you are describing is a very convoluted process.  It's never taken me that many steps to make a modification to a subVI.  I just have a feeling you are trying to do something backwards and is making it more complicated.

 

Generally, if you are building up a special datatype, you can right click on an output and choose create constant, or create control.  Copy that control to the subVI and go to the connector panel to add the new control as a terminal.  Finish wiring up things and you're done.  Steps 2 through 6 seem like an unnecessary detour.

X.
Trusted Enthusiast
Trusted Enthusiast

My bad, I probably did not make this clear enough...

The Data Type is present in the calling VI only. I want to import it in the subVI.

I agree that in an ideal world, I will know ahead of time what inputs I need for my subVI and have all the wires go through a dummy Sequence and use "Create subVI".

In a perfect world, imperfect guys like me realize later on that they need to pass something else from the calling VI to the subVI.

That's the situation I am trying to simplify.

 

X.
Trusted Enthusiast
Trusted Enthusiast

I guess I need a break!

You're right. I could create a constant on the main diagram (1), Select it (2), cut it (3), go to the subVI (4 [+1 as it is a double-click]), Paste it on the FP (5), Connect it to the Connector Pane (6 [+1 as you need to select the control AND the connector]).

4 steps less... But still 8 clicks instead of two (with some keyboard combo and contextual menu browsing, admittedly).

I know I have been doing what you are describing in the past and I remember I have stopped doing that because the results were sometimes unsatisfactory. It beats me why...

Mads
Active Participant
Dragis
Active Participant

Regardless of the exact number of clicks, being able to hover over a VI call and then wire into an open terminal to do all of that work seems like a pretty slick solution to the problem.

X.
Trusted Enthusiast
Trusted Enthusiast

Note added in proof: it will not have escaped the reader's attention that a natural extension of this suggestion is a blank 4-2-2-4 empty subVI that can be dropped on the BD... Sorry, I can't attach one to this message. This would also solve a number of other suggestions such as this and this.

X.
Trusted Enthusiast
Trusted Enthusiast

I meant to type: this and this.

X.
Trusted Enthusiast
Trusted Enthusiast

Idea above posted here.

dthor
Active Participant

I'm glad someone mentioned the easier way to do this (create control/indicator, copy to subVI). Although admittedly I wanted to be the one to point it out Smiley Very Happy I guess I shouldn't have taken the weekend off...

 

However, the underlying Idea is actually pretty cool, and thus kudos!