LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop a parallel while loop when for loop is finished

Solved!
Go to solution

Thank you for the diagram. The intent was to (like you said) stop the while loop after all iterations of the for loop are complete, not send notification after each iteration. I apologize if I didn't make that clear in the description. To put the overall program into context, the while loop will call an object that will continuously get the status of the system I am working with. The for loop is setting the number of times the user does a set of built in tests (set programmatically by another call to an object). When the set of built in tests are complete and the pass/fail criteria is logged, I want to stop getting status on the system (set in the while loop) and the vi to complete.

0 Kudos
Message 11 of 16
(932 Views)

The method of never sending any notification and use the killing of the notification to stop the while loop worked well but would you be willing to share the example of  "while loop stopping when the notification is NOT "Loop 1"". I tried to get it to work the way you described but I could not negate the string properly.

0 Kudos
Message 12 of 16
(928 Views)

@Jeffk2336 wrote:

The method of never sending any notification and use the killing of the notification to stop the while loop worked well but would you be willing to share the example of  "while loop stopping when the notification is NOT "Loop 1"". I tried to get it to work the way you described but I could not negate the string properly.


Who is the "you" that you are replying to?

 

If you read my message, you'll understand why your original VI didn't work.  And what you attached is more broken.

 

You send out a message in the notifier, end the loop, then kill that notifier.  That is what I meant by "shoot the messenger".

The message never gets to the 2nd loop.  The notifier reference goes bad, but you didn't know that because you disabled error handling.  The wait on notification, errors out give you the default notification of an empty string, which does not match Loop 1, which means it does not stop the loop.

 

Run your original VI (not this new broken one) with highlight execution turned on so you can see how the data flows. The only issue you might see is that since that mode slows down execution, race conditions that occur at normal speed might not behave the same way at slow speed.

0 Kudos
Message 13 of 16
(921 Views)

@Jeffk2336 wrote:

The method of never sending any notification and use the killing of the notification to stop the while loop worked well but would you be willing to share the example of  "while loop stopping when the notification is NOT "Loop 1"". I tried to get it to work the way you described but I could not negate the string properly.


You can quote someone by using the quotation mark in the editor tool bar.  And yeah, it took me a couple o f weeks to figure out where they moved it.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 14 of 16
(912 Views)

@RavensFan wrote:

@Jeffk2336 wrote:

The method of never sending any notification and use the killing of the notification to stop the while loop worked well but would you be willing to share the example of  "while loop stopping when the notification is NOT "Loop 1"". I tried to get it to work the way you described but I could not negate the string properly.


Who is the "you" that you are replying to?

 

If you read my message, you'll understand why your original VI didn't work.  And what you attached is more broken.

 

You send out a message in the notifier, end the loop, then kill that notifier.  That is what I meant by "shoot the messenger".

The message never gets to the 2nd loop.  The notifier reference goes bad, but you didn't know that because you disabled error handling.  The wait on notification, errors out give you the default notification of an empty string, which does not match Loop 1, which means it does not stop the loop.

 

Run your original VI (not this new broken one) with highlight execution turned on so you can see how the data flows. The only issue you might see is that since that mode slows down execution, race conditions that occur at normal speed might not behave the same way at slow speed.



I clicked reply to altenbachs post, that’s who I was referring (didnt realize there was quotation function in the editors tool bar, been using this for 3 days) but thanks for taking the time to reply. I finally understand how how this works as described. 

0 Kudos
Message 15 of 16
(904 Views)

You are best of quoting all or the relevant part of a previous message if it isn't immediately obvious who you are replying to.

 

While you might have clicked reply on his specific message, there is nothing in the forum that indicates which message you are replying to unless you quote it.  The reply button just adds a new message to the end of the thread.

0 Kudos
Message 16 of 16
(892 Views)