LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

update main VI before subVI ends

Hello,

 

In the attached .llb file, how can I update the main VI read indicator after each iteration from the subVI_1 instead of just from the last iteration?

 

Thanks,

hiNi.

0 Kudos
Message 1 of 4
(2,587 Views)

Execute the Sub VI in one loop, read the Global variable and update to the "main VI read" indicator in another parallel while loop. As per your VI you still don't have understanding on the LabVIEW dataflow.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 4
(2,557 Views)

Really,, your subVI should not have the loop.  The main VI should have the loop and you call the subVI inside of the loop.  Then you can just write straight to the terminal from the output of the subVI.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 4
(2,523 Views)

Hello hiNI,

 

Given the data flow operating principles of LabVIEW, any results being passed through the terminals of a sub VI will not be read by the calling VI until the sub VI has completed execution. Since your sub VI possesses a loop, the output terminal values will not be retrieved until all iterations of the loop have executed. This is why you only see the final value and are not seeing constant updates.

 

To see constant indicator updates, I recommend following the advice offered by crossrulz. By removing the loop from your sub VI and calling it within a loop, you can use the iterative output of the sub VI to continuously update an indicator on the front panel of the calling VI.

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