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: 

"test passed" window loses focus

Solved!
Go to solution

I'm using a slightly modified version of the example LabView Simple Operator Interface vi. I use this for the user to select which test sequence to run.

 

The problem I have is that several of the NI standard pop-up windows keep losing focus when they get displayed: the 'Enter UUT serial number', test passed/failed/terminated window and Save_As for printing test reports, are all standard NI windows that pop-up briefing and then disappear because the go behind the main Labview vi window.

 

I have to use ALT+Tab to cycle through the Windows and get back to whichever pop-up has lost focus. And the problem is that my customer wont accept this!!

 

Any ideas?

 

Thanks in advance,

Ian

0 Kudos
Message 1 of 9
(2,872 Views)

Hi Ian

I am just trying to understand better what you problem is, are you using the Modified "LabView Simple Operator Interface vi" to control a testStand sequence?

 

0 Kudos
Message 2 of 9
(2,853 Views)

Hi,

 

Yes, that's the one. The modification to that example vi is that there is a 'hard-coded' test sequence that gets called on start up. No other changes to the functionality of the example vi.

 

I have been into vi properties and then the Window Appearance tab under the drop down and it is set to modal (see attached pic)M0nk3y01"

 

0 Kudos
Message 3 of 9
(2,847 Views)

Ok, I've read around a bit more and in the Labview Help pages and can see that setting the OI vi to modal is a bad idea as this means the vi takes priority over windows (does beg the question as to why the vi was not always on top, but that's one for another time!)

 

I've changed the setting to be default appearance. This improves matters and I now have it so that the NI dialogue pop-ups stay in front of the simple OI most of the time, but if the user accidently clicks on an area outside of, say the UUT serial number dialogue box, then that box disappears behind my simple OI vi. This has probably drifted into being a Microsoft Windows management problem now, but I would really like to be able to control layering / focus / ordering via my TestStand sequence. Is there a PostUIMessage command I can use for example to minimise and maximise my simple oi vi programmatically from my TestStand sequence??

 

Thanks,

Ian

0 Kudos
Message 4 of 9
(2,822 Views)
Solution
Accepted by topic author IDavies

Hey Ian,

I know you can make a window within labview come to the front using property nodes and a VI server reference set to application. This works within labview instances but does not keep focus from other programs. I.e. does not bring a window in front of internet explorer just other labview windows.

I will keep experimenting to find if another setting will do what you want better. Meanwhile its a start for you to try as well. Let me know how you get on with this.

property nodes.png

 

Matt

Matthew Trott
Applications Engineer
National Instruments UK
www.ni.com/ask
0 Kudos
Message 5 of 9
(2,804 Views)

Hi,

 

Try using the TestStand - Start Modal Dialog.vi and TestStand - End Modal Diallog.vi.

 

It makes the calling dialog box VI modal to the TestStand main application window. Use the TestStand - End Modal Dialog VI to make the dialog box non-modal to the TestStand main application window.

 

 

Regards
Ray Farmer
0 Kudos
Message 6 of 9
(2,794 Views)

Thanks Matt,

 

You suggestion works well for me. I can put your example vi within the PostUIMessage handling part of the Simple OI vi and then just call your example as when I need to ensure the window is frontmost or rearmost.

 

Cheers,

Ian

0 Kudos
Message 7 of 9
(2,786 Views)

Ray,

 

Thanks for the suggestion. I've not tried it yet as Matt's suggestion worked for me, but I will try yours out too to see which works best in my software.

 

Thanks,

Ian

0 Kudos
Message 8 of 9
(2,785 Views)

Hey Ian

 

Glad I could help!

 

Regards

Matt

Matthew Trott
Applications Engineer
National Instruments UK
www.ni.com/ask
0 Kudos
Message 9 of 9
(2,782 Views)