01-11-2024 08:23 AM
Hi all,
Issue: I have a LabVIEW program that consists of a main VI whose front panel is the UI. It launches a subVI when a menu item is selected. The subVI opens as a dialog UI, reads some values from a text file, populates dialog controls, user enters some info, info is saved to a text file, subVI closes it's front panel. main program resumes.
This works great running in LabVIEW dev environment, but when running as a compiled exe file, the subVI front panel opens behind the main VI's front panel and the panel is not responsive. If I right-click on the task bar instance of the application and select CLOSE WINDOW. the subVI closes and control is back to the main VI.
Notes:
Thank you!
-Charlie
01-11-2024 09:30 AM
It sounds like you have a z-order stacking issue due to when the panels are opened. Try adding a small delay before launching the dialog so that it opens after the main window is fully loaded.
01-11-2024 09:57 AM
Thanks for the reply. When the main program is started, the user has to go through a login procedure (within the main program) to activate the menu item that allows the user to run the subVI. The fastest anyone could get to the subVI opening from application start is at least 30 seconds, so I'm reasonably sure it's not a race-condition.
01-11-2024 10:34 AM - edited 01-11-2024 10:34 AM
Sample code module will be easy for others to guide you in proper direction.
Few of my trials would be to
Check whether no error occurs in executable (Path varies from Dev to Executables)
Check for VI properties FP Settings.
Make Sure you have properly Mapped your Startup VI.( Should not be the reason Just a check)
01-11-2024 10:44 AM
Add this to your subVI when it pops up.
Or use this tool:
01-11-2024 12:43 PM - edited 01-11-2024 12:46 PM
@asuwish4 wrote:
The subVI opens as a dialog UI, ...
...
Neither the main nor the subVI are set for modal front panels.
...
A "dialog VI" (configured as "dialog" in VI properties...windows appearance) is typically modal, and it seems your subVI should be. Not sure why you did not set that.
@asuwish4 wrote:
This works great running in LabVIEW dev environment, but when running as a compiled exe file,
Make sure you understand the terminology. LabVIEW code is always compiled, even when running in the dev environment. You are apparent building a standalone executable.
01-11-2024 01:31 PM
You are correct. I misused the word 'dialog'. It was my intention to show that the subVI opens over the main VI. Neither the main or subVI properties are set to modal operation.
You're also correct about the compiled aspect. I just use compiled to indicate a standalone program independent of the dev env. I work with multiple programming languages and 'compiled' is our catch-all term for .exe file as a deliverable.
01-11-2024 01:35 PM
So why don't you set the subVI to modal?
01-11-2024 01:53 PM
@asuwish4 wrote:
You are correct. I misused the word 'dialog'. It was my intention to show that the subVI opens over the main VI. Neither the main or subVI properties are set to modal operation.
Okay... but why is the dialog not modal?
The fact that your UI is not responsive when it pops up underneath would seem to indicate that this is a synchronous call. That's a blocking operation, so your main VI cannot continue until the dialog returns. This is exactly when a child window should be modal.
If you want both windows to be responsive then the "dialog" must be called asynchronously so the main VI can continue running after calling it. If you need to get some data back from the dialog to the main VI then you'll need to devise a method to do that. (There are a few ways depending on what you really need to do.)
01-11-2024 02:26 PM
It works as intended in the IDE. Should I have to change to a modal window for and exe?