LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[Basic Question] My subvi doesn't work !

Solved!
Go to solution

Hello everybody !

I am very new to Labview software, and i am having a trouble when trying to use a subVi from a main VI (File attached below). My sub Vi doesn't work, although it runs smoothly when i start its from its own front panel.

I have tried using While Loop, Case Structure, ...and none of them works.

 

Thank you for reading. Here are the files:

Download All
0 Kudos
Message 1 of 4
(2,550 Views)
Solution
Accepted by topic author johnnguyen123

Your Main VI pauses when calling the subVI and waits for the subVI to finish. That is what LV is about: Dataflow implementation.

You have an incorrect understanding of LV that you obviously expect LV to run the subVI in parallel to the rest of your Main VI....

You have to look into Producer/Consumer as this enables you to provide what you want to have.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 4
(2,536 Views)
Solution
Accepted by topic author johnnguyen123

you need to create References for all controls in main VI and pass it to sub VI to update values of main VI.

 

I have modified your VI to update values of main VI control by reference.

Download All
0 Kudos
Message 3 of 4
(2,518 Views)

@Manjunatha.sn2011 wrote:

you need to create References for all controls in main VI and pass it to sub VI to update values of main VI.

 


This is typically not a good solution and belongs in the Rube Goldberg thread. We should be teaching new LabVIEW users the easy and correct ways.

 

I would strongly suggest to listen to Norbert instead!

 


@Manjunatha.sn2011 wrote:

 

I have modified your VI to update values of main VI control by reference.


If attaching modified VIs, you need to give them new names to avoid confusion. Your main VI will still call the old subVI because the browser will rename your new VI by adding a number to the end of the name to avoid file name conflicts.

0 Kudos
Message 4 of 4
(2,467 Views)