LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sticky Event

Solved!
Go to solution

Hello,

 

         My program gets stuck in an event structure.  The program involves a dynamic event.  I've attached a demo here of the problem.  The BUTTON & EVENT button works fine but buttons 2, 3 and 4 get stuck on their second press.  Any help would be much appreciated.  Thanks.

 

 

BeeEyeBye_1-1676901794841.png

 

 

0 Kudos
Message 1 of 6
(1,292 Views)

If you have two event structures in the same loop, the loop cannot go to the next iteration until both events have fired. I would suggest to fix these glaring dataflow problems.

0 Kudos
Message 2 of 6
(1,290 Views)

OK, now I am at a computer where I can look at your VI.

 

What a mess!

  • Why do you have all these weird mechanical actions if a simple switch action would work. Do you know that a "switch until released" button will fire the event twice, once on press and once on release?
  • Why do you use mouse down instead of value change events? (mouse down is useful for special cases, such as when mouse'ing on an indicator)
  • Why do you have a timeout case if the timeout is "never" (-1)?
  • All your events lock the panel until the event completes, but they cannot complete because of dataflow. catch 22. Locked up forever.
  • Your user events make absolutely no sense. What are you actually trying to achieve?
  • etc. etc.

I recommend to start with some basic tutorials.

0 Kudos
Message 3 of 6
(1,281 Views)
Solution
Accepted by topic author BeeEyeBye

Replace the outer while loop with two independent while loopsReplace the outer while loop with two independent while loops

 

Split your while loop into two parallel independent loops. I've drawn (rather expertly it has to be said 🙂 ) an idea as to where the boundaries should lie.

You'll have to work out a way to stop the second loop which, in this example, does not include a stop button.

i.e. Get rid of pink. Blue and Red need to be while loops of their own.

 

Actually, move the destroy event node OUT of the while loop, my bad.

0 Kudos
Message 4 of 6
(1,266 Views)

Intaris,

 

         Thanks for the help.  That worked great.

0 Kudos
Message 5 of 6
(1,206 Views)

I split it into two while loops.  works well.

0 Kudos
Message 6 of 6
(1,201 Views)