LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW popup window focus

I have a VI which scans several analog output voltages while measuring an input voltage.  It takes several minutes to complete a run, so I would like to be able to work on other things while it's running.  I don't want to forget about it, however, so I want it to let me know when it has finished so I can start another run.

 

The obvious thing would be to emit a "beep" when it's done.  But this computer has no speakers, and unless someone knows how to force LabView to use the built-in motherboard buzzer, then next best thing would be a popup window.  I can make a popup dialog window with no problem (i.e. the "One Buttom Dialog.vi"), BUT the popup window must grab focus from whatever other Windows application I'm using: MATLAB, explorer, firefox, etc.  Grabbing focus, I cannot figure out.  The dialog window pops up, but I don't see it unless LabView is the application with focus.  It comes up behind Explorer, or MATLAB, etc.

 

Any advice?

0 Kudos
Message 1 of 4
(4,901 Views)

Does the Beep.vi under the Graphics and Sound palette use the motherboard speaker? I'm not sure if it does. I have a laptop, and I know it uses the PC Speaker, but I don't know if this is true for desktops. That might be an option.

 

Instead of using the built in popup function make your own. Make a SubVI that uses a while loop and simply states something like, "Restart Test" and then a boolean to stop that while loop. For this new VI, go to VI Properties -> Windows Appearance. In the bottom left of this menu there is a radio button with 4 items. Select the last one, which is Custom, and then click the customize button. Under window Behavior Select "Floating" and under that deselct "Allow user to minimize window". In the bottom left select "Show front panel when called" and "Close afterwards if originally closed". This will give you the behavior in a popup you are looking for.

Message 2 of 4
(4,873 Views)

The Beep.vi will work for the motherboard speaker. Just make sure to wire false to the use system alert input so you can control the duration and frequency.

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 3 of 4
(4,865 Views)

Thank you for your input zenthoef and GovBob.

 

If the options above don't fit your needs, you can also check out the following forum:

http://lavag.org/topic/12751-how-do-you-make-your-application-window-frontmost/

or specifically, the VI attached in the following post

http://lavag.org/topic/12751-how-do-you-make-your-application-window-frontmost/page__view__findpost_...

 

I've verified that it works, but you must set the index to 0 in the 'Index Array' function, next to the call chain.

Che T.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(4,857 Views)