NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I keep a LabVIEW dialog floating in front while displaying a Message Popup?

Solved!
Go to solution

Quick Summary:

My customer has a status bar implemented in LabVIEW that they are displaying by executing a TestStand sequence in a new thread. During their main execution, they then need to display prompts to the operator using Message Popup steps. We cannot figure out how to keep both the LabVIEW dialog and message popup steps in front of the Operator Interface.

 

The behavior I want is to display the LabVIEW dialog from a new thread, and for that dialog to always be on top of all windows. Then to display a message popup from the original thread and allow the user to dismiss that dialog, all while still keeping the LabVIEW dialog visible. And of course, this has to be done using the LabVIEW Run-Time Engine because it is a production station.

 

Details:

Here’s why I need that behavior:

  • My customer is locking down the OS on their production station. The operator cannot use ALT-TAB to change windows. Therefore both windows must be accessible by clicking.

  • My customer has a program that starts on OS startup and takes up the whole screen, thereby denying access to the desktop. They also have the Operator Interface set to full screen. Any window that ‘goes to the back’ goes behind the OI and is unrecoverable by clicking.

  • The operator prompt requires the operator to click the ‘OK button‘ to close. Thus it must be able to have focus.

I have tried all combinations of the following, none of which give the behavior I want. The resulting behavior I describe is after the LabVIEW dialog and the Message popup have both been displayed.

  • LabVIEW dialog settings
    • Top-Level Application Window
    • Float (Do Not hide when LabVIEW inactive)
    • Modal
    • Float and set FP.IsFrontmost
    • Modal and use TestStand API Start/End Modal Dialog VIs
    • Float and use TestStand API Start/End Modal Dialog VIs
  • Message Popup Settings
    • Normal
    • Float
    • Modal

 

I’m attaching the sequence file, LabVIEW, and CVI code that I was testing with. You can test the panel's behavior by clicking running from the Sequence Editor, and then clicking on the sequence editor once both windows are open. If the LabVIEW dialog is set to floating or normal, clicking on the Sequence Editor puts the dialog behind the sequence editor. If the dialog is set to modal, if focus is given to the dialog while the message popup is active, the message popup cannot be dismissed until after the dialog is closed (the OK button is unresponsive).

 

As a reference, I found that I can get the behavior I want if I code the dialog in CVI, set the panel to ‘Float Always’ and use ‘Float’ for the Message popup.

 

Does anyone have anything else I can try? Is there another LabVIEW setting I’m missing?

Josh W.
Certified TestStand Architect
Formerly blue
0 Kudos
Message 1 of 8
(7,472 Views)
How committed is your customer to the LabVIEW status bar? I avoided the whole multiple window nonsense by writing to the status bar on the oi with a uimessage.
Message 2 of 8
(7,456 Views)

Unfortunately, the dialog is more than a status bar. Each GUI is UUT specific. It displays the state of the UUT and some measurements from the UUT.

 

Technically it is still possible to use uimessages with a LabVIEW sub-panel on the User Interface, but the customer has a standard UI that they have approved, and cannot change it.

Josh W.
Certified TestStand Architect
Formerly blue
0 Kudos
Message 3 of 8
(7,430 Views)

I'm not sure about LabVIEW, I'm not as good as Knutson, but I'll take a look at the sequence you have uploaded and see if there is anything I can find in TestStand. UI Messages are probably your best bet or your CVI workaround.

Rob S
Applications Engineer
National Instruments
0 Kudos
Message 4 of 8
(7,399 Views)

Any ideas? I still need to resolve this issue (or give an acceptable workaround) for my customer.

 

Are there any other LabVIEW settings I can try other than the ones in the VI properties that I've already tried? In scripting maybe?

Josh W.
Certified TestStand Architect
Formerly blue
0 Kudos
Message 5 of 8
(7,339 Views)

@Josh_W wrote:

Any ideas? I still need to resolve this issue (or give an acceptable workaround) for my customer.

 

Are there any other LabVIEW settings I can try other than the ones in the VI properties that I've already tried? In scripting maybe?


Not directly TestStand, but there is this thread on the LAVA forums about managing LabVIEW windows as frontmost using Windows API functions...

 

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

 

 

 

 


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 6 of 8
(7,322 Views)

I had seen that thread on LAVA, but there is quite a bit of conflicting information on it so I wanted to make sure there wasn't a LabVIEW solution first. I'll go investigate the Windows API functions and report back.

 

Thanks.

Josh W.
Certified TestStand Architect
Formerly blue
0 Kudos
Message 7 of 8
(7,313 Views)
Solution
Accepted by topic author Josh_W

I ended up using one of the VIs that was posted in that LAVA thread: http://lavag.org/topic/12751-how-do-you-make-your-application-window-frontmost/#entry76322

I modified it slightly to show the window in SetWindowPos function (option SWP_SHOWWINDOW, 0x40). I'm attaching it here for anyone who finds this thread later. I also had to make my popup VI's Window Appearance "Default" (i.e. not floating nor modal) for this to work.

 

By calling this VI in my popup VI (executed by the LV-RTE), my popup VI will stay visible even when the MessagePopup is displayed from another thread. It also stays on top if the TestStand OI loses focus.

 

Thanks for everyone's help!

Josh W.
Certified TestStand Architect
Formerly blue
Message 8 of 8
(7,296 Views)