06-05-2012 04:55 PM
My application allows the users to start any number of VIs. The enclosed PNG file shows how this is done. Now I want to turn this application into a EXE. How should I set the Build properties so the user may select the desired VI(s)? The PPT file shows how my Project is structured. Eventually the application will be installed in computer that does not have LabVIEW. I am using LV 2011.
06-05-2012 05:25 PM
Disclaimer, I might be missing a few details, but I'm doing something along this line.
If you already have the main VI compiled into a EXE, you can add the "Custom Panels" directory to the "always included" in the source files of your main exe. From there, you treat the main EXE as a directory (C:\main.exe\subdirectory\Panel.vi) for calling VI's within. A bit of searching will get the details of how to find exactly where they are within the exe.
What I'm doing in my project is adding each panel to the "always included" by hand. Not sure if adding a whole directory works. Let me know if it does.
06-05-2012 05:43 PM
You may also want to use the Asynchronous node to start your VI. Since it was added in LV 2011 this is the prefered method for dynamically loading and running LV code.
As mentioned above place all of your dynamic code in the Always Include section of the build spec.
As an alternative you might want to look at this design pattern. It is a more felxible design since the loadable modules are plugins. Very easy to add or modify your application since the main engine doesn't require a recompile to extend it.
06-06-2012 01:48 PM
The VIs that the user might selected are "Always included" the the Build Specification. (see enclosed PPT file). But they do not seem to be part of the EXE. As a matter of fact, it seems that when the user selects them, from their location in the Windows file system, LV is trying to run them as if they were in development mode.
How would I make use of an Asynchronous node when I don't know the type definition of the user selected VI?
06-06-2012 01:59 PM
The "Always Included" VIs are built into the executable. However, it appears that you're trying to load the VIs from their actual location on disk - an absolute path - so you're not getting the version built into the executable. One possible solution would be to change the target destination of the Always Included VIs in the build specification, and locate them in their folder so the user can navigate to them in the standard file browser.
06-07-2012 10:48 AM
I'll try that, however, I did try to find them in C:\builds\ObsvrMultiPanelApp\ObsvrMultiPanelApp.exe\subdirectory\testXXX.vi, and they were not there.
06-07-2012 11:13 AM
@faustina wrote:
I'll try that, however, I did try to find them in C:\builds\ObsvrMultiPanelApp\ObsvrMultiPanelApp.exe\subdirectory\testXXX.vi, and they were not there.
Sorry, I didn't literally mean "subdirectory". I meant that they may be located in a subdirectory within the exe. I shouldn't have included it.
Try this
http://digital.ni.com/public.nsf/allkb/FD7DE8BC8FFC256C862565F4006BE363
If you're still stuck, I ran into problems too...
Most examples show the VI being directly underneath the executable. In my project, they ended up one subdirectory underneath.
I found out the location experimentally by creating a small subVI containing this
Then,
1) Place it in the same directory as your other VI's
2) Directly call it somewhere within your main block diagram (not dynamically)
3) Put it in the "always included" list. Same as the other VI's
4) Compile
5) Run the executable. You'll get a nice popup that tells you where it got placed.
06-07-2012 11:18 AM
I should have been more clear ... when I search for the file within the executable I have C:\builds\ObsvrMultiPanelApp\ObsvrMultiPanelApp.exe\data subdirectory and the VIs are not there. There is no other subdirectory under .exe.
06-07-2012 11:22 AM
Are they here?
C:\builds\ObsvrMultiPanelApp\ObsvrMultiPanelApp.exe\testXXX.vi
In my confusing way, I was saying all examples show them directly under the exe. Not always the case, but I guess usually the case.
If neither works, try the experimental way I showed.
06-07-2012 11:24 AM
no I can't seem to find them anywhere under the .exe. I'll try your solution.