LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running simultaneous multiple tasks

I have looked over both the simple and advanced multiple task examples. I have set up my program to run based off the simple example using local variables to pass data between the two difference tasks. However, I cannot get my program to run both while loops at the same time. The program executes the first loop and once it is finished then executes the second loop. I need both loops to be executing at the same time. I have attached my programs (a lot of sub vi's). How do I force the program to execute both loops at the same time and pass data from the "analog input" loop to the "analog output" loop.
0 Kudos
Message 1 of 5
(6,744 Views)

R.

 

First- clean up  your block diagram and try to limit scrolling on your block diagram to 1 direction only.  Most times you can break your code into managable pieces.

 

Conside using a state machine.  [Initialize, acquire, process, file, exit] would be the easiest break out for this code. and allow it to be much easier to debug

 

You waste a lot of space and the various structures are placed haphazardly making it harder than necessary to folow the data flow.  Add discriptions for your controlls and indicators (use tip strip too)

 

Now that i'm done criticising:  

attached is a shot of your code.  yoou have wired an output of one loop to the input of the next.  the second loop cannot start until the first exits.


"Should be" isn't "Is" -Jay
Message 2 of 5
(6,736 Views)

Yup! that is the first problem.

 

 

 

The next problem will be that the data read from the local for ouput purpose will probably be read befoe it is written.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 5
(6,730 Views)

Thanks for the input. After removing the input to the second loop both loops execute simultaneously.

 

 

0 Kudos
Message 4 of 5
(6,709 Views)
Don't forget to mark the "solution" or give kudos as desirved
0 Kudos
Message 5 of 5
(6,693 Views)