05-19-2009 11:08 AM
So I posted a problem yesterday about getting 'elapsed time' express vi to provide updates from a sub-vi to the calling vi. It was suggested that I create a parallel process in the sub-vi that will run the elapsed time function at the same time the other processes are running. I tried to implement this idea, but ran into a problem. The elapsed time process is a While loop paralleled with the main While loop in the sub-vi, It updates every second, based on my time delay, and when I view the running sub-vi, the elapsed time indicator is updating as it should. The calling vi, however, is not seeing these updates. I have wired an indicator to the sub-vi icon, but does not change until the sub-vi finishes.
Also, the other problem with the parallel process is that it runs forever, regardless of the other loop finishing. I have tried to wire an or'd bool to the stop inside the While loop, but when I do that, the elapsed time process does not start.
I have tried data binding a shared variable in the project, and then dragging that to my calling vi, but again I get no updates on the elapsed time.
Any ideas????
05-19-2009 11:23 AM
Research how to communicate between loops. What you are doing can be accomplished with Notifiers (that's what I'd use), Queues, or Global/Shared Variables.
Your issues appear to be due to a lack of understanding of the LabVIEW data-flow paradigm. Check out the Producer / Consumer example. Post code here and see if one of us can give more guidance.