LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behavior of stop control with events

I have found some strange behavior while using stop controls. I have a main vi which has two while loops. One of them is used to continuosly acquire the images. The other while loop has event structure that has several booleans which trigger different events. Both the while loops are operated using the same stop. My problem is this. None of the events get triggered when I press the buttons for them. However if I keep the stop value true( which stops the acquisition) and then click the event buttons all of them work fine. so every time I want an event to run I first change this stop value to true and then press the button for the event to fire. I want to know what is causing this? Why is th stop button influencing the behavior
of other events?
0 Kudos
Message 1 of 7
(3,170 Views)
Try highlighting execution to see what is preventing the events from being handled.

Can you post your code here? It's probably a data dependency or something similar, but it's tough to tell without seeing the code.

Tim
0 Kudos
Message 2 of 7
(3,170 Views)
I tried execution highlighting and what I found was that the while loop that does the image acquisition never stops until the stop button is pressed. and so it keeps looping in the first loop no matter what event button is pressed. once I make the stop true it comes out of that loop and goes to the other one. How can I change this. The problem is that I need to keep the acquisition running through out and the event actions have to take place simultaneously.So the first while loop should be running all the time while the second one is triggered by events. Is there a way to do this
0 Kudos
Message 3 of 7
(3,170 Views)
If your while loops are completely independent then it whould work. I've attached a simple example in LabVIEW 6.1 that shows a while loop with an event structure and another running continuously. A single stop button stops both but until then, the event structure will respond to clicking on two other Booleans in the VI.
0 Kudos
Message 4 of 7
(3,170 Views)
The problem is that the while loops are not independent. The images acquired by the while loop are sent to the second while loop for pattern matching etc to be done. So does this mean that I cannot have the two while loops running together. Can you propose another way of accomplishing this?
0 Kudos
Message 5 of 7
(3,170 Views)
You could just pass the data from the acquisition loop to the other via a local variable.
0 Kudos
Message 6 of 7
(3,170 Views)
Thanks a lot for your help!It solved my problem

Hema
0 Kudos
Message 7 of 7
(3,170 Views)