07-09-2014 07:39 AM
I have two event loops which need to trigger when the Exit button is clicked on. Is it ok to trigger both loops off the same control? It has been working great, but I'm not sure if there could be an issue. Please see below. Thank You!
Solved! Go to Solution.
07-09-2014 08:37 AM
I would just question why you have two event structures in the same VI. In general, you should just have one place that handles GUI events and then you can pass commands off to other processes using queues.
07-09-2014 08:53 AM
Ahhh! Good point. I think it's because I decided to include a separate while loop to control my menu after the main code was built and didn't think of inlcluding the menu event in the original event structure. Another point may be that I have 50 ms wired to the timer in the MENU event structure and don't want any delay in the MAIN Event structure. Not sure if this is a valid point.
07-09-2014 08:56 AM
@sfrosty wrote:
Another point may be that I have 50 ms wired to the timer in the MENU event structure and don't want any delay in the MAIN Event structure. Not sure if this is a valid point.
Why? Are you doing something else in that loop?
I would recommend moving your menue stuff into your main event loop. You will thank yourself later.
07-09-2014 10:19 AM
Will do! Thanks for your help!
07-09-2014 10:58 AM
Oops! I misread your question:
Why? Are you doing something else in that loop?
Yes, I'm using the MENU timer event case (50ms) to process an Exit global!
07-09-2014 11:02 AM
Waiting on Exit global timer event.
07-09-2014 11:41 AM
Oh, and I won't need the Exit global loop if I place the menu event case in the main event case.
07-09-2014 11:42 AM
07-09-2014 11:43 AM
Got it!