LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SubVI front panel works as code but not when compiled

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:

  • Running Windows 10, LabVIEW 2020, 32-bit.
  • Neither the main nor the subVI are set for modal front panels.
  • I cannot attach the code due to company IP restrictions, maybe close-up pics of specific areas.  Though, I suspect this is not a coding error but something in VI properties or the build specification.

Thank you!

-Charlie

 

0 Kudos
Message 1 of 14
(1,544 Views)

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.

0 Kudos
Message 2 of 14
(1,505 Views)

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.

 

 

 

 

0 Kudos
Message 3 of 14
(1,495 Views)

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)

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 14
(1,484 Views)
0 Kudos
Message 5 of 14
(1,478 Views)

@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.

 

0 Kudos
Message 6 of 14
(1,460 Views)

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.

 

 

0 Kudos
Message 7 of 14
(1,442 Views)

So why don't you set the subVI to modal?

0 Kudos
Message 8 of 14
(1,440 Views)

@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.)

0 Kudos
Message 9 of 14
(1,426 Views)

It works as intended in the IDE.  Should I have to change to a modal window for and exe?

0 Kudos
Message 10 of 14
(1,414 Views)