From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dr. Damien's Development - The Xylophone Project XII - Executable

This time, we go through the build process to produce an executable and installer. Before starting, there was a bit of housekeeping to perform. Here is what was changed.


  • Enable the close panel function in the main VI exit case (it had been disabled for development).
  • Put a title on the main VI.
  • Add icon and default .INI files to the project.
  • Add a build process for the executable
  • Add a build process for an installer.

The first three items make the finished product work like you would expect it to. The application will have an appropriate title and icon. It closes when you exit.


To place a custom title on the main VI, open it, right click on the icon, and select VI Properties. Select Window Appearance from the Category listbox. Uncheck Same as VI name and enter the name in Window title. If you wish to programmatically set the title, you can do this with the VI property Front Panel Window»Title. This is useful if you localize your code.


The .INI file is a text file with the name of the application in square brackets as the first item. Since we are not setting anything by default, this is the entire file. The application uses this file to save calibration data. The .INI file was placed in the Support folder of the project with the icon. The icon was created as part of creating the build process. The Icon category in the build specification contains a simple icon editor. You can create icons with any icon editor and use them by specifying their location in the build specification.


The build process for the executable is created by right clicking on the Build Specifications leaf of the project and selecting New»Application (EXE). This creates a build process and pops up the properties dialog for it. Right click on the Make Win32 EXE build specification in the attached project to launch the finished build specification. The first category is basic information.


Click on Source Files under Category to show the source files. Despite the many VIs, we only need to list the top level VI, Xyl.lvlib:XylophoneTuner.vi, as the startup VI. The rest will be linked and added as necessary. Click on Destinations to show where the files will be stored. Make any changes you wish to the Destination path.


Click on Source File Settings to change how the build uses the source files. Usually the defaults are good. In this case, I renamed the main VI, Xyl.lvlib:XylophoneTuner.vi, but this is not necessary. If you click on Customize VI Properties..., you can override the settings of the VI properties. If this case, the main VI properties are overridden so that it runs when opened. Doing this here instead of the main VI properties allows for easier development. In addition, there is a bug in LabVIEW 8.5 (since fixed) which requires you to set the property here.


The icon category was mentioned previously. Click the Advanced category to set advanced properties. Ensure that Enable debugging and Wait for debugger on launch are not checked. The default .INI file is also specified here, using Configuration file in project and unchecking Use the default LabVIEW Configuration file (LabVIEW.ini).


Click on the Addition Exclusions category. All but the last checkbox should be checked to reduce the size and load time of the final executable.


Version information is set in the Version Information category. Run-time languages similarly.


The Preview category can be used to generate a trial run of the project. This is useful to determine if you have set the locations correctly and included all your files.


When done, click the Build button to generate the executable. Note that you can also build by right clicking the build specification from the project and selecting Build.


Now that we have an executable, we need an installer. You can choose to simply copy the files from the build, but this will not install all the dependencies, particularly the LabVIEW runtime engine. To solve this issue, we need another build, this time for the installer. Right click the Build Specifications tab in the project and select New»Installer to start the process. An installer build, Win32 Installer is included in the attached project. Right click it and select Properties to open it. All information was left at defaults except the Product Information and Source Files..


The Product Information was filled in with the standard information. You can choose to autoincrement the product version or manually set it yourself.


The Source Files was populated with the contents of the EXE build. Under Additional Installers, the LabVIEW 8.5.1 runtime was automatically selected. Select a different runtime if you are using a different version of LabVIEW.


Run this build as you did the previous one. You will now have an installer which can be zipped or burned to a CD. We now have a functional Windows application for tuning xylophone, marimba, or glockenspiel bars. I will be using it on a laptop until the Windows Mobile port is completed.

 

Attached below are the source code and executable. The installer is not attached due to its size. To use the executable, copy to the directory of your choice, then install the LabVIEW 8.5.1 runtime engine. Or you can create the installer yourself!

WARNING! — Tuning marimba or xylophone bars generates a huge amount of sawdust. Be sure to protect your computer or PDA (not to mention yourself!).


Previous Installments


Download All
Message 1 of 2
(3,236 Views)
Interesting work
0 Kudos
Message 2 of 2
(3,204 Views)