LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run sub VI in another VI

Solved!
Go to solution

I have a subVI and I want to run in another VI. As you see in the attached file, subVI can not receive any parameter from UsingVi.vi. How can I fix the problem?

 

Download All
0 Kudos
Message 1 of 6
(5,029 Views)
Solution
Accepted by Mmehrabin

Why do you have a loop in your sub-vi?

 

How do you plan on stopping that loop?

 

Remove the loop from your sub-vi and put it in your top level vi.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 6
(5,024 Views)
Solution
Accepted by Mmehrabin

Your subVI has  a while loop that can only be stopped by hitting the stop button, which you can't hit because the front panel of the subVI is closed.

 

The loop belongs in your main VI.  The subVI should not have a loop.

 

These are all basic rules of LabVIEW's dataflow.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

Message 3 of 6
(5,023 Views)

In my subVI I need a shif register. Without the while loop how can I implement the shift register? By feedback node?

 

0 Kudos
Message 4 of 6
(4,960 Views)
Solution
Accepted by Mmehrabin

@Mmehrabin wrote:

In my subVI I need a shif register. Without the while loop how can I implement the shift register? By feedback node?

 


What you showed doesn't have or need a shift register in the subVI.  It is a simple subVI that behaves like a function.  Take inputs, make calculations, send out the outputs.

 

If your subVI does more  than what you showed, then:

 

You can put in a feedback node.

You can put in an uninitialized shift register on a while loop, and use a True constant wired to the stop terminal.  This is also know as a functional global variable or an Action Enginet.

 

Or put the shift register on the while loop in the main VI.  Pass your array or data into and out of the subVI> 

Message 5 of 6
(4,955 Views)

Thank you  so much. It fixed.

0 Kudos
Message 6 of 6
(4,892 Views)