From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using KeyFocus in TestStand

My LabView VI in the attachment sets string input box key-focused and waits for a text input scanned in. The VI stops running when a user presses ok button. When the VI runs in LabView environment, KeyFocus wroks fine. But, when it runs as a TestStand step in a sequence file, the KeyFocus feature does not work. I will always have to click on the text box first. This is a problem when a user forgot to click on and try to scan in. Attached files are the VI and the sequence file. I simplified to make my point. Please, advise how I can use the KeyFocus feature in TestStand/LabView environment as is in LabView only environment.
Download All
0 Kudos
Message 1 of 5
(2,591 Views)
Hi LegalEngineer,

Unfortunately you have stumbled across a bug within TestStand.  There is a problem where the TestStand window gets set to the front most window right after the LabVIEW front panel launches which causes the control to lose its keyfocus.  I made a slight modification to your VI that should provide a workaround.   Let me know if you still have the problem with this VI.
Pat P.
Software Engineer
National Instruments
Message 2 of 5
(2,574 Views)
Patrick,
 
Thank you for responding to my post.
I tried your VI. The problem still resists. You mentioned that TestStand window got set to the front when the LabView launched and that was why VI panel lost the control of the KeyFocus. From what I observed, I have to disagree with you. Both VIs set the panel to the front with or without altering the property programatically. Even if the VI step were moved into a longer sequence and called after the LabView launched a minute ago, the KeyFocus did not work. Then I clicked on the window many times to see if the KeyFocus was controlled. Nothing changed. If it were true that putting the panel to the front helped getting KeyFocused, the clicking on the panel window would have resumed the control of the KeyFocus. But, the clicking on the window didn't change anything. I had to click on the text box first.
 
KJ
0 Kudos
Message 3 of 5
(2,568 Views)
Hi LegalEngineer,

I apologize I may have misunderstood your problem.  The error I described above is when you are creating a dialog window modal to TestStand within LabVIEW.  Your example is not attempting to do this.  However, for me delaying when I set the keyfocus still solved the problem.  I tested with TestStand 3.0,3.1, and 3.5 with LabVIEW 7.0, 7.1, and 8.0.  What version of TestStand and LabVIEW are you using?  Also do you have the LabVIEW adapter selected to run with the run time engine or the LabVIEW development system?
Pat P.
Software Engineer
National Instruments
0 Kudos
Message 4 of 5
(2,559 Views)

My application runs on TS3.0 and LV7.0. The run option "LabView RunTime Engine" is not checked. That might be why it takes a while to load LabView engine. The run-time engine should be faster to load.

I tried running the VI with a delay 10 second first. It worked. Then, I set the delay back to be a more reasonable wait - reasonable enought to deceive eyes, under a quarter second. Now, it works with 0.1 sec delay. I am still not sure what went wrong last time I tried. Hope this fix be permanent. Thanks.

0 Kudos
Message 5 of 5
(2,550 Views)