LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to build exe with user selected VI

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.

Download All
0 Kudos
Message 1 of 18
(2,693 Views)

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.

Josh
Software is never really finished, it's just an acceptable level of broken
0 Kudos
Message 2 of 18
(2,681 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 18
(2,673 Views)

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?

0 Kudos
Message 4 of 18
(2,648 Views)

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.

0 Kudos
Message 5 of 18
(2,644 Views)

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.

0 Kudos
Message 6 of 18
(2,627 Views)

@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

Location.png

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.

Josh
Software is never really finished, it's just an acceptable level of broken
0 Kudos
Message 7 of 18
(2,623 Views)

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. 

0 Kudos
Message 8 of 18
(2,619 Views)

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.

Josh
Software is never really finished, it's just an acceptable level of broken
0 Kudos
Message 9 of 18
(2,614 Views)

no I can't seem to find them anywhere under the .exe.  I'll try your solution.

0 Kudos
Message 10 of 18
(2,610 Views)