LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pass value from subvi to vi

Solved!
Go to solution

Hello,

I attached below my main vi and the subvi. In the subvi is a simple timer in a while loop that starts upon a Boolean button and stops when the time passes. The problem is that I can't see the value of the timer while the subvi is running, on my main vi and I just get the value after the timer ends. I tried to solve the problem using references but I can't get it to work. I think I'm missing something. Can you please help me?

Download All
0 Kudos
Message 1 of 7
(5,256 Views)

The subVI doesn't pass out data to the main VI until it completes.  One of the basic dataflow rules.

 

This question has come up before.  Here is one message thread that answeres it.  main VI is not updating the data from subVI.

0 Kudos
Message 2 of 7
(5,233 Views)

One solution, amoung others, is to insert the sub-vi in a panel so you can see it update.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 7
(5,221 Views)

@chis20 wrote:

I tried to solve the problem using references but I can't get it to work. I think I'm missing something. Can you please help me?


i dont see any references? i must be missing something....

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

Thanks, guys for the reply. I saw the topic before but I was still wondering if there is a way to keep my while loop in the subvi, because this is the problem, and do it with some other way. But I quess there isn't. 

0 Kudos
Message 5 of 7
(5,182 Views)
Solution
Accepted by topic author chis20

Yes there is.

 

And if you read message 3 in the link I gave, it would have given you this link.  How Can I Update the Changes Made to a Control/Indicator from a SubVI on the main VI?

 

This shows you how to pass the reference of a main VI control into the subVI, so that the subVI can update it by using a Value property node.

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

I just followed the instructions and I did it! Smiley Very Happy Thanks!

0 Kudos
Message 7 of 7
(5,143 Views)