LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

main VI is not updating the data from subVI

Solved!
Go to solution

Dear all,

 

I have a Vi A using the data front a subVi B. When I run it, I see the data is updating in the subVI, but not the main Vi and the Front Panel. The subVi has three output channels and the main Vi tries to display those three channel data on the Front Panel.

 

Could somebody tell me how I can solve the problem?

 

Thanks a lot.

 

Roy

0 Kudos
Message 1 of 6
(4,577 Views)
Solution
Accepted by topic author powerplay

My guess is that you have a while loop in your subVI. If so, the main is not supposed to be updated as the subVI runs. It will only get updated when the subVI finishes. That's basic dataflow. If you have the front panel of the subVI visible, why do you need to show the same data in the main. Depending on how you call your subVI, you can't do anything with the main until the subVI finishes anyway. That is also basic dataflow.

 

You might explain what exactly you want the subVI and main to do. Attach the main and subVI

0 Kudos
Message 2 of 6
(4,568 Views)

You could probably use Control Refnums but as Dennis mentioned, be sure to explain the use case to us.

How Can I Update the Changes Made to a Control/Indicator from a SubVI on the main VI?

Message Edited by Adnan Z on 06-02-2009 02:48 PM
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 3 of 6
(4,562 Views)

I agree with Dennis' hypothesis.

If the subVI has a while loop in it, data will not be passed to the main VI until after the subVI is finished.

So what you could do is remove the most outter while loop within the subVI.

Then put a while loop around where the subVI is called within the main VI.


This way, you can access the data as it is being updated in the main VI.

 

If that did not make any sense, let me know and I will try to rephrase it.

Cory K
0 Kudos
Message 4 of 6
(4,557 Views)
thanks you guys a lot for the answer. It's right I have a for loop inside the subVI. I need to move that loop to the main VI.
0 Kudos
Message 5 of 6
(4,534 Views)
I mixed up my logic in the main VI and subVI since I wrote the subVi first, which works well. Then I wanted to change it to a subVI and made the main VI look clean and then I made such a simple mistake.
0 Kudos
Message 6 of 6
(4,532 Views)