LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.net object asynchronous calls in parallel (while loop and for loop) not executing as expected

Solved!
Go to solution

When I run my vi, as soon the the code runs in parallel, the while loop with the "GetInitState" object executes once then exits (Not expected, the notifier does not stop the loop until the for loop finishes executing) and the for loop path continues to execute. When the for loop path enters the second while loop, the same object continues to operate until the exit condition is met (as expected).

 

Why does the parallel while loop only execute once then stop? 

 

This is the first time attempting this in code. Is there an issue calling .net objects in parallel where one continues to execute while the rest of the program calls other .net objects asynchronously..?

 

Note: the beginning part of the vi is deleted but works just fine. The vi is just to show the portion where I am experiencing the issue.

0 Kudos
Message 1 of 3
(1,030 Views)
Solution
Accepted by topic author Jeffk2336

Your wait on notification has infinite timeout (-1), thus the upper while loop will just sit there waiting for "done", then stop. If you want it to iterate every 200ms, set the timeout to that and you can even remove the other wait function.

0 Kudos
Message 2 of 3
(935 Views)

@altenbach wrote:

Your wait on notification has infinite timeout (-1), thus the upper while loop will just sit there waiting for "done", then stop. If you want it to iterate every 200ms, set the timeout to that and you can even remove the other wait function.


Your solution was correct, and the vi runs as expected now. Thank you very much. 

0 Kudos
Message 3 of 3
(905 Views)