Jump to content
ParkerJonathan

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

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Join the conversation

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

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