From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use a VI in a larger VI? VI in VI

Hi Labview users,

I have a VI and I want to use it in a larger VI. 
Larger VI is s-w-parameter
I want to use Spectrum VI instead of bgs VI.
Spectrum Vi works well in itself.

But when I want to use it instead of bgs VI, the input and output data is a problem.
I need some experts help.

Thanks

0 Kudos
Message 1 of 11
(3,024 Views)

Hope you need t go through basic LabVIEW tutorials. Though calling a VI inside another VI is pretty simple to explain, you should understand basics.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 11
(3,016 Views)

just simply make an llb from llb manager and whenever you need insert the vi by select vi in blockdiagram by right click

0 Kudos
Message 3 of 11
(3,006 Views)

@jyot445 wrote:

just simply make an llb from llb manager and whenever you need insert the vi by select vi in blockdiagram by right click


It's been 15 years since I last heard someone recommend using an llb. Even then, usually followed by the advice not to use them.

 

.llbs used to be terrible instable. One write error, and the entire llb is corrupt. That might have improved. Still using the project explorer, combined with libraries (.lvlibs), classes, (virual) folders, really eliminates all the needs for .llbs. That provides a much better drag\drop experience.

 

So there are quite a few ways to get a subvi into a diagram:

  • A diagram Right click>Select A VI..>Browse.
  • Select in project, drag\drop into the diagram.
  • Select in Windows Explorer, drag\drop into the diagram.
  • Right click a wire, select Insert, All Palettes, Select a VI..>Browse.
  • On the diagram, press CTRL+Space, type (part of) VI name, select the VI, press enter.
  • Select a wire, press CTRL+Space, type (part of) VI name, select the VI, press CRTL+I.

Probably a few more.

Message 4 of 11
(2,998 Views)

Really, brother! How could I not think? Tutorials!!! Oh my god!! You have a brilliant brain. This message does not require much IQ to look at the files and tell what went wrong.

0 Kudos
Message 5 of 11
(2,963 Views)

@AnnihilationSpectrum wrote:

 

But when I want to use it instead of bgs VI, the input and output data is a problem.



It does take a lot of brain power to understand your message.  You have a lot of large VI's that are difficult to follow, and you have not clearly stated what your problem is in that sentence of yours.

 

The entire message comes across as "I don't know how to use subVI's", and the only solution to that is to take the tutorials.  If you have a specific more complicated problem than that, then you need to clearly show what the problem is.  Throwing a bunch of busy VI's into a message won't help anyone help you solve your problem.

Message 6 of 11
(2,957 Views)

@AnnihilationSpectrum wrote:

Really, brother! How could I not think? Tutorials!!! Oh my god!! You have a brilliant brain. This message does not require much IQ to look at the files and tell what went wrong.


Uhmm… You've been looking at those files as well?

 

In general, it's not wise to bite the hand that feeds you. Nor nice. Not even if you don't like the food.

Message 7 of 11
(2,945 Views)

@AnnihilationSpectrum wrote:

Really, brother! How could I not think? Tutorials!!! Oh my god!! You have a brilliant brain. This message does not require much IQ to look at the files and tell what went wrong.


Judging by your question and your code, I would say taking a few tutorials is advice you should not ignore.

 FSCapture.PNG

========================
=== Engineer Ambiguously ===
========================
Message 8 of 11
(2,930 Views)

Looking at your code, the Spectrum VI performs a lot more functionality than the bgs VI.  As you said, you can run Spectrum VI standalone just fine.

 

Spectrum VI isn't a direct replacement for bgs VI, so it makes sense why the output data doesn't match up.

 

If you need to dynamically swap between bgs VI and Spectrum VI, I would recommend modifying bgs VI to encapsulate more of the functionality (where you are formatting the spectrum graph) into that subVI itself.

 

Basically what you are proposing to do is fit a square peg in a round hole.  You need to modify one thing or the other to get it to work for your needs.

 

I also agree that some tutorials might describe how to better encapsulate your code and provide structure to allow for you to make this application more modular if that is your desire.

Message 9 of 11
(2,917 Views)

@AnnihilationSpectrum wrote:

Really, brother! How could I not think? Tutorials!!! Oh my god!! You have a brilliant brain. This message does not require much IQ to look at the files and tell what went wrong.


Thanks for the compliment! 

Your problem statement made me to think how to use a VI inside a larger VI (using sub vi inside a calling VI) 

 

Hope many provided useful suggestions,  ultimately goal is to find the solution, not about finding individual IQ level. 

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 10 of 11
(2,899 Views)