LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parallel process run independently, but do not stop when vi completes

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????

0 Kudos
Message 1 of 2
(2,654 Views)
A VI must finish looping before it has an available output (the terminal on the sub-vi icon).  

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.

 

Richard






0 Kudos
Message 2 of 2
(2,641 Views)