LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structures and while loops

I have a program that uses event structures to look for mouse click events in the ui. I also want the program to poll a hardware switch and watch for a relay to close. Someone on this board suggested that I have my polling loop throw a flag when the relay closes and have my event structure look for that flag.

I have a polling while loop next to my event structure (both are inside a large while loop to stop the program). But it seems that my event structure never triggers. I watched with the highlighting on, and I just went around and around in my polling loop, even when an event should have triggered. My guess is that I shouldn't have the while loop next to the event structure like that, but I can't think of how I should structure it.

Thank you.
Kasey
0 Kudos
Message 1 of 3
(2,342 Views)
Hi Kasey

You should have your event-structure in one while-loop and your polling in one while loop.

If you have both in the same while loop, in the first iteration the polling-loop is started and runs until stopped.

Your flag can be a dynamic event. Just have a look at the examples included in labview.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 2 of 3
(2,341 Views)
Thanks. That seems to work.

Kasey
0 Kudos
Message 3 of 3
(2,323 Views)