10-22-2013 12:40 PM
My mainVI calls a subVI which outputs a value based on the given input. I want the output from the subVI to update in my mainVI instantaneously as the subVI is running. Currenlty the output in my mainVI arrives only after the subVI has completed execution. I need to have instantaneous output from subVI in my mainVI so that way I can use that instantaneous value to do other calcuations.
I tried using reference as the output, but even with that method the output only arrives at the end of the subVI execution.
10-22-2013 01:23 PM - edited 10-22-2013 01:28 PM
Your VIs are a mess and full of race conditions and beginner mistakes. Many code parts don't make a lot of sense.
If you read and write to local variables (e.g. the done?" boolean), you need to ensure that it is set to FALSE before the loop starts and the code has a chance to read the potentially stale value. Else you get race conditions. (LabVIEW does not execute left-to-right, execution order is only determined by dataflow).
Incrementing in a loop is better done with shift registers instead of hordes of local variables.
Here's a simplified and corrected version. See if it does what you want. Modify as needed. There are many improvements possible.