ParkerJonathan Posted August 13, 2018 Report Share Posted August 13, 2018 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. Quote Link to comment
Neil Pate Posted August 13, 2018 Report Share Posted August 13, 2018 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). 1 Quote Link to comment
hooovahh Posted August 13, 2018 Report Share Posted August 13, 2018 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 Quote Link to comment
Tim_S Posted August 13, 2018 Report Share Posted August 13, 2018 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. Quote Link to comment
Benoit Posted August 14, 2018 Report Share Posted August 14, 2018 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. Quote Link to comment
Stagg54 Posted August 14, 2018 Report Share Posted August 14, 2018 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. Quote Link to comment
Neil Pate Posted August 14, 2018 Report Share Posted August 14, 2018 (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. Edited August 14, 2018 by Neil Pate Quote Link to comment
ThomasGutzler Posted August 15, 2018 Report Share Posted August 15, 2018 How about the OpenGDS way of things? Just put a property node on the BD that references a front-panel element. Like this: Quote Link to comment
Benoit Posted August 15, 2018 Report Share Posted August 15, 2018 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. Quote Link to comment
ParkerJonathan Posted September 12, 2018 Author Report Share Posted September 12, 2018 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). This worked for me. Thank you. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.