Jump to content

VI with a Tab Control freezes when pressing Tab key


Recommended Posts

Hi,

I put a tab control in my program just to hide some constants, non-GUI stuff. I have also set all the controls in the Vi to skip when tabbing because Tab key has a special function in my VI (I have written an event structure + key down event). However, when I run my VI and press a Tab key, my VI freezes and CPU utilization becomes 100%, I have tried anything I can think of (like setting timeout to the event structure, setting the tab control itself to skip tabbing...etc) but the only workaround is making a "dummy" control (i.e. A control which does nothing but doesn't skip tabbing). Another solution is just avoid using tab control altogether.

I tried to reproduce the problem by making a simple VI with a tab control, an event structure with key down event handling Tab key, but it doesnt freeze at all even I have set all controls to skip tabbing. I can't figure out which part of my VI interferes the tabbing. Has anyone had similar issue before? What do you guys think about what is happening?

Thanks

Link to comment

is the "Lock front panel until event case for this event completes" check box checked for this case?? if so un checking this will stop the front panel frezzing but this will not resolve the problem if the code is getting stuck in the event case.

what process are you running in the event case for the tab structure??

have you got a while loop in the event case??

if so a time delay will stop the code using 100% of the CPU also you will need to make sure that the while loop stops executing so that the event can complete

Link to comment

Hi chris1983 and jhoskins,

Thanks for your reply. I know I didnt tell you guys enough to figure out what happened. In my first post I just want to know if anyone had the same problem and give me some insight if someone did. Now I am going to talk more about it.

Here is a screenshot of my program, take a look:

There are 3 loops running in parallel, the one at the top captures mouse scroll event from WIN32 API and fires custom event. The one in the middle is just an event handler and the bottom one is a state machine. The screenshot also shows the event handler that is triggered when Tab key is pressed down.

I've just tried un-checking "Lock front panel until event case for this event completes" for all events, as well as putting a wait timer (for 250 msec) in the loop around the event structure. But it turned out both didnt help solve the problem....Actually it is not a big deal as I can work around this by just placing a "dummy" control, but I still want to know what happened. I think that the top loop is the most likely to be the trouble-maker, but I can't find other ways to take advantage of mouse scrolling in LabVIEW 8. Please let me know if you know LabVIEW 8 has native support to mouse scrolling.

As always, if you find something weird and awkward in my program please let me know too. I have been programming in LabVIEW for just ~7 months and I am always eager to learn from you guys out here :)

Link to comment
I think that the top loop is the most likely to be the trouble-maker, but I can't find other ways to take advantage of mouse scrolling in LabVIEW 8. Please let me know if you know LabVIEW 8 has native support to mouse scrolling.
If you suspect this is the source of the problem, you can simply remove that loop and see if this keeps happening. The message queue VIs use a reentrant DLL, so I don't think that it should lock the UI thread in any way, but it is easy to check.

LV has support for mouse scrolling (although unfortunately not in the event strucutre) if you go to the Advanced>Input palette (not sure where it is in 8). I think it was Jean-Pierre Drolet who once posted an example showing this here. Try searching for it.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.