LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a new local variable from VI to a SubVI

Solved!
Go to solution

I think my title explains the situation decently, current subVI has local variable inputs, and I want to add another but have no idea how (and couldn't find anything concerning local variables with this). I can make a subVI with local variables, but I can't add any in.

 

Thanks

0 Kudos
Message 1 of 7
(5,091 Views)

@GV_KawaiiDesu wrote:

I think my title explains the situation decently, current subVI has local variable inputs, and I want to add another but have no idea how (and couldn't find anything concerning local variables with this). I can make a subVI with local variables, but I can't add any in.

 

Thanks


I have been coding in LabVIEW since the last millennium and been answering questions about LabVIEW for the last 15 years and I can say without question that NO your title and body of your question does not tell me what you are trying to do.

 

Try rephrasing the question and include some sample code with comments and arrows etc. that illustrate what you are asking.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 7
(5,072 Views)
Solution
Accepted by GV_KawaiiDesu

I'll give it a go Ben,  The magic 8-Ball to the rescue.

 

I believe the OP selected some code on a largeish Block Diagram that contained a local variable or two then hit Edit, Create subvi.  Now he has a subvi that contains local variables wired to his connector pane and wants to add a new input.

 

You need to:

  1. open the sub.vi 
  2. place a control of the right data type on the subvi front panel
  3. wire the new control to the subvis connector pane
  4. save

Now you can wire your new input to the subvi


"Should be" isn't "Is" -Jay
Message 3 of 7
(5,061 Views)

yes, this is what I was asking about, thank you! 

 

Can this work if I want the new input to be a local variable from the original VI?

0 Kudos
Message 4 of 7
(5,055 Views)

Any wire of the correct data type can be wired to the new input.

 

You might want to look into some of the online getting started material

 

8-Ball calibration proven


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 7
(5,049 Views)

I actually have it all figured out, just wasn't sure if this worked for local variables too (but it does), thanks!

0 Kudos
Message 6 of 7
(5,036 Views)

@GV_KawaiiDesu wrote:

I actually have it all figured out, just wasn't sure if this worked for local variables too (but it does), thanks!


No, you don't have it all figured out.  But, you are learning:Smiley Wink


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 7
(5,008 Views)