03-21-2012 03:15 AM
Hi all,
I have a VI with a graph and various controls. The user sets up the parameters and sees the results on the graph using an event loop, and then presses start. Once start is pressed, the block diagram exits the event loop and performs actions connected to hardware.
I have found out that if after pressing start the user moves his mouse over the graph, the front panel freezes. If I remove from the event loop the "mouse move" event, it does not. This freeze happens after user pressed start and after the event loop was exited, so it should not affect anything at all. The block diagram continues running and the VI exits normally, but for the duration the user cannot press anything on the front panel.
I have attached a simplified version of our code. There is an event loop with mouse move and start, and after that it exits the event loop and waits for 30 seconds. If you don't move your mouse over the graph during these 30 seconds, you will be able to press on the tabs in the tab control. If you do, the front panel freezes and you can't press on these tabs any longer.
The workaround I am using now is to make the graph invisible after pressing start, but this is extremely inelegant. Removing the mouse move event is not an option. Does anyone have any ideas why this happens and how to solve it?
Thanks,
Danielle
Solved! Go to Solution.
03-21-2012 10:14 AM
Your VI is password protected so I have no idea what your code is actually doing. If you are using an event structure, I suspect that your "mouse move" event has the following checked. If it does, then uncheck it to see if that helps!
03-21-2012 01:22 PM
Hi,
Sorry! Please find attached the file without a password.
The checkbox is indeed checked, but the event loop is not active once "start" is pressed (the while loop ends). Doesn't that mean that it should not matter?
Thanks,
Danielle
03-21-2012 01:32 PM
I'm not sure what all this is doing, but I think the appearance of your code freezing is due to the 30 second delay you have to the right of your loop. Why is that there? If you wait thirty seconds after pressing start does the program exit?
03-21-2012 01:56 PM
for static events the event is registered when the VI starts to run and remains registered.
So LV is doing what you told it to do "lock FP when the mouse moves over it".
YOu have two options;
Either un-check the "lock FP..." or use DynamicEvent registration so you can Unregister the mouse move event when you do not want it to be active.
Ben
03-21-2012 03:02 PM
Hi,
Zenthoef - it's wating for 30 seconds so that you can see that it freezes if you move over the graph. The original code is communicating with hardware. It does not freeze because of the wait, but only after moving the mouse over the graph.
Ben, thanks for the explanation! Unfortunately, I tried unchecking the "lock front panel" and it made the situation worse - now the front panel is frozen almost all the time (even before pressing start). I'll give dynamic event registration a shot.
Thanks,
Danielle
03-21-2012 03:03 PM
Which event did you uncheck the "lock front panel" for that mad ethe problem worse?
03-21-2012 03:28 PM
Hi,
I unchecked on Intesity Graph: mouse move.
Thanks,
Danielle
03-21-2012 03:38 PM
Danielle -
Something else is probably wrong. I unchecked the "lock front panel" boolean like I suggested in my first post. On start up I could select all of the tab controls, and everything else seemed fine. Then, I pressed "start", moused over the intesnity graph, and the front panel was not locked. Did you change something else from the code your posted besides unchecking the "lock front panel" boolean for the mouse move event?
03-22-2012 02:47 AM
zenthoef -
You are right, when disabling the graph-visible I enabled some other code that caused the problem. your solution worked great!
Thank you both very much!