Jump to content

Open VI Front panel programmatically without having to include the.vi in the build


Recommended Posts

Posted

Open VI Front panel programmatically without having to include the.vi in the build folder.

I'm using the invoke node to open the front panel and passing in a reference from a static vi reference. This appears to need the .vi file in the build folder to work but I would prefer not to include the .vi file as it's not very professional.

Any help appreciated.

Posted

You should not need the VI in the build directory, all you need to do is change the Source File Setting for the particular VI (Build-->Source File Settings-->Remove front panel, make sure this is unticked).

Capture.PNG

  • Like 1
Posted

There is also a way to have LabVIEW include the front panel of a VI when building an EXE, that doesn't require project editing and is instead on the VI level.  I'm not fully sure what these VI settings are, but what is happening is the compiler tries to determine if the front panel of a VI is used, and if it isn't then it removes it.  If you can adjust the VI to convince the compiler to keep it, then it doesn't need to be explicitly kept from the project settings. 

Some of these settings that I believe will convince the compiler to keep the front panel, is to adjust the Window Appearance settings of the VI.  For instance one thing I do is select the Dialog option, and then under Customize I will change Window Behavior to Default.  These VIs will have their front panel kept and I believe it is because things like Show Front Panel When Called makes the compiler believe this is a VI that will be shown to the user.  I think there are other things you can do to, like adding a property node in the block diagram that does an operation on the front panel.  This again makes the compiler believe it should keep the front panel

Posted

Property and invoke nodes can also uncheck 'Remove front panel' when 'Use default save settings' is checked. Ones that reference the front panel certainly do (e.g., front panel->open), but I'm not sure about ones that reference controls.

Posted

Try this:

It is like magic. Since it is a strictly type reference, It will be included in your build. if it's a GUI, set the windows Appearance like you want.

dynamic call.png

Posted

Benoit's suggestion is spot on.  That's what I've always done and never had a problem.  And you never have to remember to include the vi in your build or mess with any build settings.

Posted (edited)

Sure, I do this all the time too for my free-running processes/actors, but for the situation as simple as a custom dialogue box it makes much more sense (to me at least) to call it as a regular sub-VI instead of convoluting the code with a dynamic call (just to get the FP not removed).

Inevitably what happens is I forget to change the settings in the build, however it is pretty simple to just re-build with the corrected settings.

Edit: I actually do it slightly differently, preferring to use the VI path rather than the name. Probably does not make much of a difference though.

Actor Launch.PNG

Edited by Neil Pate
Posted

OK... but it's like using global variables... It's not very standard. and can be quite difficult to know where it comes from. If you put it in a sub vi, even this sub vi is doing nothing... I think it would be better.

  • 4 weeks later...
Posted
On 8/13/2018 at 0:43 PM, Neil Pate said:

You should not need the VI in the build directory, all you need to do is change the Source File Setting for the particular VI (Build-->Source File Settings-->Remove front panel, make sure this is unticked).

Capture.PNG

This worked for me. Thank you.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.