LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to end two parallel loops using rendezvous after finite number of sweeps

Solved!
Go to solution

Hi all,

 

I am trying to end the parallel loops using Rendezvous VIs when the loops reach some limit. I can do this with a click of the button using the stop button / event loop / close rendezvous, but for some reason, when I try to write a true to the stop button when a step-limit is reached, this does not work. It just hangs there, and still needs me to physically click the button. The event diagram uses value change for the stop button, which I thought is exactly what happens when I write true to the stop button (instead of clicking the button).

 

Can anyone explain why this is the case? My rookie attempt is attached.

0 Kudos
Message 1 of 4
(1,941 Views)
Solution
Accepted by topic author Alisterio

So the reason your VI doesn't stop is because no event triggers the Event Structure.

You're setting the "Stop" button by local variable in the second loop, but this doesn't trigger a value change event.

 

You could optionally use a Property Node, in which case you can wire the "Value Change (Signalling)" property to true, but that's an odd kludge.

 

If the question here is about why, hopefully that answers it.

If instead you'd like to do something specific with options for stopping like a button or a counter, where the whole VI ends when either occurs, I'd suggest something like using Create User Event, Generate User Event, and Register/Unregister for Events, like below:

 

cbutcher_0-1624332600676.png

 

I didn't change other loops, and I haven't added the Event case you'd need for the Event Structure, but the dynamic terminals are added by right clicking on the Event Structure and clicking "Show Dynamic Event Terminals".

Then you get a new Event with a name based on the value wired to the Create User Event, here the event name would be "<Stop>: User Event" (under Dynamic).

 

This can be used to trigger the Event Handler when the (in this case second) loop exits.

 


GCentral
0 Kudos
Message 2 of 4
(1,926 Views)

A little off-topic - how do you use the rendezvous?  I never felt the need to use it before, but maybe I am missing out on an easier way to do some things.

 

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.
0 Kudos
Message 3 of 4
(1,888 Views)

Thanks cbutcher for your reply! Sorry for not getting back to you sooner! It works now and I am thankful for your speedy help. 

0 Kudos
Message 4 of 4
(1,780 Views)