LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

keyboardAcqurie.vi freezes when several other VIs are open

Hi,
 
I have a problem with the keyboardAcquire.vi. I use it to provide manual control of the axes of my teststand. The LCONTROL-Key is used as "Enable"-Signal, and you can use LEFT, RIGHT, UP, DOWN, PRIOR (PG UP) or NEXT to start the positioning.
 
Problem: When several VIs are opened and you hold the keys to achieve continous movement, the keyboardAcquire.vi works just a few times and then freezes.
 
I've built a VI that uses the same mechanism; instead of sending the start command to an axis controller, a random number is generated and displayed. I've attached the VI within this post.
 
When you run this VI, everything works fine. Now just open some (about 15-20) of NI's example-VIs (do not run them). Note that when you run my VI and hold down e.g. the LCONTROL and LEFT keys, the loop won't iterate and no random number will be generated, since the keyboardAcquire.vi freezes after a some loop iterations.
 
My computer has still got enough memory when the example VIs are opened and task manager says everything's fine, but the keyboardAcquire.vi doesn't work as suggested...   
 
Another interesting issue is that when you put the focus away from LabVIEW to any other Windows application (e.g. calculator, editor or explorer), the VI will work as suggested.
 
Can you give hints how to solve this problem? I cannot use the Event Structure for key capturing, because my start commands have to be sent in a minimum period of time to achieve continuous movement.
 
I am using Windows XP and LabVIEW 8.2 (English version at the moment).
 
Best regards,
Manuel 
 
 
0 Kudos
Message 1 of 7
(3,383 Views)
Hi,
 
LabVIEW 8.2.1 (in german language) arrived today. Unfortunately, the keyboardAcquire.vi shows nearly the same behaviour (it doesn't freeze completely when the buttons are held down, but the execution is halted very often for some time).
 
Please help me...  Smiley Sad
 
Best regards,
Manuel
0 Kudos
Message 2 of 7
(3,350 Views)

Hey Manuel,

I tried to reproduce the desciped behaviour running your VI with about 25 VIs in memory. On my system it works fine exept pressing LCtrl+Left, then the loop time becomes about 300ms instead of the 1ms entered. The funny thing is, using the other keyes works without problems. Another thing I encountered was, after opening the task manager to view the processor load no random number will be shown or updated, so that the indicator is 0. When working with 1ms timing and pressing LCtrl + any Key exept Left the processor load is in a normal area (>10%). When pressing LCtrl+Left the first processor is at about 55%, the second at about 25%. I don't know why on my system the Left Key makes such problems while the others work.

So, first question, why is it necessary to have 15-20 VIs in memory (open) while working with your application? The problem can be that the event queue of the operating system has to handle a lot of references because of all the open windows. This could be a problem for determin the correct window for the event handler to assign one of the key events.

BR, Christian

0 Kudos
Message 3 of 7
(3,349 Views)
Hi Christian,
 
thanks for your response.
 
In my application, there are only two Frontpanels opened when using the keyboardAcquire.vi. But the application has got large number of VIs (> 150). I simply found out that it is possible to reproduce the same behaviour keyboardAcquire.vi has in my application when you run my "Keyboard Test.vi" and open about 15 of NI's example VIs.
 
On my system, the "Left"-Key is the worst, too. It's the easiest way to reproduce the missbehaviour. After I had the problem with the "Left"-Key, the other keys won't work 100% properly, too.
 
Have you tried to open another Windows program like calculator or editor/notepad and setting the focus on it? On our PCs, the "Keyboard Test.vi" then behaves correctly, even when "Ctrl"+"Left" is pressed. I am wondering what is different in this case. Maybe the LabVIEW-VI gets the key events on another way when its front panel isn't frontmost? 
 
Best regards,
Manuel 
 
 
0 Kudos
Message 4 of 7
(3,343 Views)

Hi Manuel,

Yes, I can see the same behaviour. With e.g. the calculator open and 29 VIs in memory it works without problems, without calculator open the LCtrl+Left strikes. This could be voodoo or something!

I will forward this to R&D, maybe they know the reason. But it could take some time for an answer.

 

BR, Christian

0 Kudos
Message 5 of 7
(3,329 Views)

Hi Manuel,

This seems to be a problem with the UI-Thread. Currently we are working on this issue, I will let you know if I get any information.

One crazy thing is, if you first press the key up/down/left/right key and then the Left-Ctrl, it works!

BR, Christian

0 Kudos
Message 6 of 7
(3,314 Views)

Hi Christian,

"One crazy thing is, if you first press the key up/down/left/right key and then the Left-Ctrl, it works!"

This is a very good message! Smiley Happy

I can tell the users of my teststand to press the keys this way. That's a first workaround.

Best regards and many thanks for this useful hint,

Manuel

0 Kudos
Message 7 of 7
(3,303 Views)