labview appliction builder
TRANSCRIPT
8/9/2019 LabVIEW Appliction Builder
http://slidepdf.com/reader/full/labview-appliction-builder 1/41/4 www.ni.c
1.
2.
3.
4.
5.
6.
7.
1.
2.
3.
4.
5.
1.
2.
1.
2.
3.
3.
1.
Distributing Applications with the LabVIEW Application Builder
Publish Date: Aug 23, 2013
Overview
This article is part of a series on software engineering practices and tools for large application development in LabVIEW.
to view the list of other articlesClick here
Software developers rarely intend for a finished application to be used only on the development computer. To address this issue, National Instruments provides the LabVIEW Application Builder
user-friendly tool that enables LabVIEW users to configure build specifications:
Stand-alone applications that can be distributed to users who have the LabVIEW Run-time Engine.Packed project libraries that package multiple files in one location with a project library as the root file.
Shared libraries that call LabVIEW code from text-based programming languages, such as LabWindows/CVI, Microsoft Visual C++, and Microsoft Visual Basic.
Source distributions that package LabVIEW source files, which can be distributed to other LabVIEW developers.
Installers that install stand-alone applications and shared libraries created for the Windows platform.
Zip files that are useful for distributing a large amount of code as a single, portable file.
Using build specifications differs significant ly depending on the version of LabVIEW you use. Refer to the for the most detailed and up-to-date information about the ApplicationLabVIEW Help
Builder. You can access the by selecting in LabVIEW.LabVIEW Help Help»LabVIEW Help
The LabVIEW Professional Development System includes the Application Builder. If you use the LabVIEW Base Package or Full Development System, you can purchase the Application Builder
separately.
You must have LabVIEW 8 or higher to complete these tutorials. Some text may differ in the software depending on which version of LabVIEW you use.Note:
Table of Contents
Preparing the LabVIEW Project
Stand-Alone Applications
Packed Project Libraries
Shared Libraries
Installers (Windows)
Source Distributions
Zip Files
Building Applications with the Application Builder
The LabVIEW Application Builder leverages the organization provided by the LabVIEW Project, which organizes and manages all of the files associated with an application. These files include V
project libraries, documentation, data files, hardware configuration and more. The Application Builder creates applications from user-specified files in a LabVIEW project, and individual build
settings are saved in the project.
The following examples use existing VIs to step through the tasks for configuring build specifications in LabVIEW. Download the attached VIs to complete each example. You must have a projec
open and saved to configure a build specification.
1. Preparing the LabVIEW Project
Download and unzip the file attached to this document.tutorial_files.zip
Select to create a project.File»New Project
Right-click and select from the shortcut menu to add a directory of files to the project as a folder. Navigate to the files from .My Computer Add»Folder tutorial_files.zip
Click the button to add the directory to the project. The folder appears under in the window.Current Folder Application Builder My Computer Project Explorer
Save the project as in a new directory named . Use this project to complete the examples.TutorialProject AB Tutorial
Note If you previously hid in the window, you must display the item again to access it. To view , click the buttBuild Specifications Project Explorer Build Specifications Filter Project View
and select .Build Specifications
2. Stand-Alone Applications
You can develop stand-alone applications (executables) that only require the LabVIEW Run-Time Engine to run on systems without LabVIEW installed. Complete the following steps in each tasto configure the application build specificat ion and build and run the application. Refer to the for the most detailed and up-to-date information about building stand-aloneLabVIEW Help
applications. You can access the by selecting in LabVIEW.LabVIEW Help Help»LabVIEW Help
Configuring the Build Specification
From the window, right-click and select from the shortcut menu to display the dialog box.Project Explorer Build Specifications New»Application Application Properties
Complete the following steps on the page of the dialog box.Information
Enter in the text box. The text box contains the name of the application build specification that appears under in theTutorial-EXE Build specification name Build Specifications
window.Project Explorer
Enter in the text box. The text box contains the filename on disk for the executable file.Tutorial.exe Target filename
Click the button next to the text box and navigate to the directory. Create a subdirectory named . Double-click the directory anBrowse Destination directory AB Tutorial App App
click the button to select the directory. When you build the application, the executable file appears in this directory.Current Folder
From the list on the left, click to display the page, which contains settings you can use to specify which files are included and how they are included iCategory Source Files Source Files
the application. Complete the following steps on the dialog box page.
From the tree, click the folder to expand it. Select . Click the arrow button next to the listbox to add the VI to theProject Files Tutorial Files AB Tutorial GUI.vi Add Item Startup VIs
listbox. VIs you add to the listbox open and run when you run the application.Startup VIs
8/9/2019 LabVIEW Appliction Builder
http://slidepdf.com/reader/full/labview-appliction-builder 2/42/4 www.ni.c
2.
3.
1.
2.
3.
1.
2.
3.
4.
5.
6.
1.
2.
1.
2.
3.
3.
1.
2.
3.
4.
5.
6.
1.
2.
3.
1.
2.
1.
2.
3.
3.
1.
2.
1.
From the tree, select . Click the arrow button next to the listbox to add the VI to the listbox. Files you add Project Files AB Tutorial MeanMedianMode.vi Add Item Always Included
the listbox are in the application, but the application calls them dynamically as needed.Always Included
Repeat the previous step to add the following files to the listbox: , , and . Do not add tAlways Included AB Tutorial StndDev.vi AB Tutorial Histogram.vi datafile.txt
other files, which are for use in other examples.
Note If you move a VI to the listbox on the page, but you choose a destination in the page that is not the same destination as the builtAlways Included Source Files Source File Settings
application, the Application Builder moves all dependencies of the VI to the destination you designate, rather than keep the dependencies in the built application. If two or more VIs that are alwa
included or top-level VIs call a VI and try to move it to two different locations, the Application Builder moves the VI and all subVIs to the built application. To make a VI that is specified as Includ
move to a new location, you must specify the VI as on the page.referenced Always Included Source Files
From the list, select the other dialog box pages to explore the settings you can configure in a build specification for an application. For this exercise, do not change the settings oCategory
these dialog box pages.
From the list, click to display the page. Click the button to view a preview of the files that the Application Builder creates when you build theCategory Preview Preview Generate Preview
application. You can use this preview to verify that the Application Builder will create the files you want in the directories you want. You can correct errors before you build the application.
Click the button to close the dialog box and update the project with the build specification settings. The build specificat ion appears under in theOK Tutorial-EXE Build Specifications Pro
window.Explorer Building and Running the Application
Save the project. LabVIEW does not save build specifications settings on disk until you save the project.
Right-click the build specification and select from the shortcut menu to build the application. A dialog box displays the progress of the build. When the dialog box displaTutorial-EXE Build
the message, click the button.Build Complete Done
Navigate to the directory. The directory should contain the executable file , the LabVIEW configuration settings file , and theAB Tutorial\App Tutorial.exe Tutorial.ini data
directory, which contains the support files and .datafile.txt lvanlys.dll
Double-click to run the application. A file dialog box prompts you to navigate to and select the file, located in the directory created with the applicatioTutorial.exe datafile.txt data
Click the button to load data in the buffer. Click the button to display the data in the graph on the right. Select an analysis to perform in theAcquire Data Graph Data Type of Analysis
section and click the button to display statistics on the data.Analyze
Click the button to close the application.Stop
3. Packed Project Libraries
Complete the following steps in each task to configure the build specificat ion settings and build the packed project library. Refer to the for the most detailed and up-to-dateLabVIEW Help
information about building shared libraries. You can access the by selecting in LabVIEW.LabVIEW Help Help»LabVIEW Help
Configuring the Build Specification
From the window, right-click and select from the shortcut menu to display the dialog box.Project Explorer Build Specifications New»Packed Library Packed Library Properties
Complete the following steps on the page of the dialog box.Information
Enter in the text box. The text box contains the name of the shared library build specificat ion that appears underTutorial-packedlib Build specification name Build Specificat
in the window.Project Explorer
Enter in the text box. The text box contains the filename on disk for the executable file.Tutorial-packedlib.lvlibp Target filename
Click the button next to the text box and navigate to the directory. Create a subdirectory named . Double-click theBrowse Destination directory AB Tutorial PackedLib Packed
directory and click the button to select it. When you build the shared library, the files appear in this directory.Current Folder
From the list on the left, click to display the page, which contains settings you can use to specify which files are included and how they are included iCategory Source Files Source Files
the shared library. Complete the following steps on the page of the dialog box.Source Files
From the tree, click the folder to expand it. Select . Click the arrow button next to the listboProject Files Tutorial Files AB Tutorial Library.lvlib Add Item Top-level Library
add the VI to the listbox.
From the tree, select . Click the arrow button next to the listbox to add the VI to the listbox. Files yoProject Files AB Tutorial MeanMeadianMode.vi Add Item Always Included
add to the listbox are in the packed library, but the packed library calls them dynamically as needed.Always Included
Repeat the previous step to add the datafile.txt file to the listbox.Always Included
From the list, select the other dialog box pages to explore the settings you can configure in a build specification for a packed library. For this exercise, do not change the settings Category
these dialog box pages.
From the list, click to display the page. Click the button to view a preview of the files that the Application Builder creates when you build theCategory Preview Preview Generate Preview
packed library. You can use this preview to verify that the Application Builder will create the files you want in the directories you want. You can correct errors before you build the packed
library.
Click the button to close the dialog box and update the project with the build specification settings. The build specificat ion appears under in thOK Tutorial-packedlib Build Specifications
window.Project Explorer
Building the Packed Library
Save the project. LabVIEW does not save build specifications settings on disk until you save the project.
Right-click the build specification and select from the shortcut menu to build the shared library. A dialog box displays the progress of the build. When the dialog bTutorial-packedlib Build
displays that the build is complete, click the button.Done
Navigate to the directory. The directory should contain the packed library file and the support files andAB Tutorial\PackedLib Tutorial-packedlib.lvlibp datafile.txt
.lvanlys.dll
4. Shared Libraries
Complete the following steps in each task to configure the shared library build specification and build the shared library. Refer to the for the most detailed and up-to-date informaLabVIEW Help
about building shared libraries. You can access the by selecting in LabVIEW.LabVIEW Help Help»LabVIEW Help
Configuring the Build Specification
From the window, right-click and select from the shortcut menu to display the Shared Library Properties dialog box.Project Explorer Build Specifications New»Shared Library
Complete the following steps on the page of the dialog box.Information
Enter in the text box. The text box contains the name of the shared library build specificat ion that appears underTutorial-sharedlib Build specification name Build Specificat
in the window.Project Explorer
(Windows) Enter in the text box. The text box contains the filename on disk for the executable file. (Mac OS X) EnterTutorial-sharedlib.dll Target filename
. (Linux) Enter .Tutorial-sharedlib.framework Tutorial-sharedlib.so
Click the button next to the text box and navigate to the directory. Create a subdirectory named . Double-click theBrowse Destination directory AB Tutorial SharedLib Shared
directory and click the button to select it. When you build the shared library, the files appear in this directory.Current Folder
From the list on the left, click to display the Source Files page, which contains settings you can use to specify which files are included and how they are included inCategory Source Files
shared library. Complete the following steps on the dialog box page.
From the tree, click the folder to expand it. Select . Click the arrow button next to the listbox toProject Files Tutorial Files AB Tutorial MeanMedianMode.vi Add Item Exported VIs
add the VI to the listbox and display the dialog box. LabVIEW exports VIs you add to the listbox so you can send and return values to and from theDefine VI Prototype Exported VIs
shared library.
Complete the following steps from the dialog box.Define VI Prototype
Click the parameter in the listbox. Verify that the description begins with .return value Parameters Function Prototype void
8/9/2019 LabVIEW Appliction Builder
http://slidepdf.com/reader/full/labview-appliction-builder 3/43/4 www.ni.c
2.
3.
4.
3.
4.
5.
6.
4.
5.
6.
1.
2.
3.
4.
1.
2.
1.
2.
3.
3.
4.
5.
1.
2.
3.
4.
6.
7.
8.
9.
1.
2.
3.
4.
1.
2.
1.
Verify that the listbox includes an input named and outputs named , , and .Parameters Array mean median mode
If the function does not contain these parameters, click the blue (+) button to add the parameters and set the values to input or output.Add Function
Click the button to save the configuration settings and close the dialog box.OK Define VI Prototype
From the tree, select . Click the arrow button next to the listbox to add the VI to the listbox and display theProject Files AB Tutorial StndDev.vi Add Item Exported VIs Define VI
dialog box.Prototype
From the dialog box, complete the steps listed above for the , but with different parameters. Verify that theDefine VI Prototype AB Tutorial MeanMedianMode.vi Parameters
listbox includes an input named and an output named .Array standardDeviation
From the tree, select . Click the arrow button next to the listbox to add the VI to the listbox and display theProject Files AB Tutorial Histogram.vi Add Item Exported VIs Define VI
dialog box.Prototype
From the dialog box, complete the steps listed above for the , but with different parameters. Verify that theDefine VI Prototype AB Tutorial MeanMedianMode.vi Parameters
listbox includes an input named and an output named .Array HistogramOut
From the list, select the other dialog box pages to explore the settings you can configure in a build specification for a shared library. For this exercise, do not change the settings Category
these dialog box pages.From the list, click to display the page. Click the button to view a preview of the files that the Application Builder creates when you build theCategory Preview Preview Generate Preview
shared library. You can use this preview to verify that the Application Builder will create the files you want in the directories you want. You can correct errors before you build the shared libr
Click the button to close the dialog box and update the project with the build specification settings. The build specificat ion appears under in thOK Tutorial-sharedlib Build Specifications
window.Project Explorer
Building the Shared Library
Save the project. LabVIEW does not save build specifications settings on disk until you save the project.
(Mac OS X) To build part of a shared library in LabVIEW, Application Builder must use gcc, the standard command-line compiler for Unix and Mac OS X operating systems. Use Xcode, the
standard development environment for Apple computers, to install gcc. You can download Xcode for free from the Mac App Store.
Right-click the build specification and select from the shortcut menu to build the shared library. A dialog box displays the progress of the build. When the dialog boTutorial-sharedlib Build
displays the message, click the button.Build Complete Done
Navigate to the directory. The directory should contain the shared library file , the file that containsAB Tutorial\SharedLib Tutorial-sharedlib.dll Tutorial-sharedlib.h
parameter prototypes for the shared library functions, the LabVIEW configuration settings file , and the directory, which contains the support files for the shared librarTutorial.ini data
You can call the shared library from a number of programming languages, including LabVIEW and C.
5. Installers (Windows)
You can create a single installer that will install the LabVIEW Run-Time Engine, any hardware drivers, and MAX configuration settings necessary for running the application. Complete the follow
steps in each task to configure the installer build specification and build and run the installer. Refer to the for the most detailed and up-to-date information about building installerLabVIEW Help
for Windows. You can access the by selecting in LabVIEW.LabVIEW Help Help»LabVIEW Help
Configuring the Build Specification
From the window, right-click and select from the shortcut menu to display the dialog box.Project Explorer Build Specifications New»Installer Installer Properties
Complete the following steps on the page of the dialog box.Product Information
Enter in the text box. The text box contains the name of the installer build specificat ion that appears under inTutorial-Installer Build specification name Build Specifications
the window.Project Explorer
Enter in the text box. The text box contains the name that displays when the installer runs.AB Tutorial Product name
Click the button next to the text box and navigate to the directory. Create a subdirectory named . Double-click theBrowse Installer destination AB Tutorial Installer Install
directory and click the button to select the directory. When you build the installer, the files appear in this directory.Current Folder
From the list on the left, click to display the page, which contains settings you can use to specify which files are included and how they are included iCategory Source Files Source Files
the installer.
From the tree, click the build specification to select it. From the tree, click the folder to select it. Click the arrow buProject View Tutorial-EXE Destination View TutorialProject Add Item
next to the tree to add the application build specificat ion files to the installer.Destination View
From the list, click to display the page, which you can use to create shortcuts to the files that the installer installs and to determine the location of theCategory Shortcuts Shortcutsshortcuts. Complete the following steps on the page to create a shortcut on the desktop.Shortcuts
Click the button to display the dialog box. Double-click the file to select it.Add Shortcut Select Target File Tutorial.exe
Change the setting in the ring to so the shortcut appears on the desktop.Directory [All Users Desktop]
Change the text in the text box to .Name Tutorial Application
Delete the text in the text box so the shortcut appears directly on the desktop and not within a subdirectory.Subdirectory
From the list, click to display the page, which you can use to include National Instruments product installers that you need in the instaCategory Additional Installers Additional Installers
build. The listbox contains a list of the installers available on the computer.National Instruments Installers to Include
Place a checkmark in the checkbox, if a checkmark is not already present, to include the LabVIEW Run-Time Engine in the installer and all its componentsNI LabVIEW Run-Time Engine
Users who want to run the application must have the LabVIEW Run-Time Engine installed.
From the list, select the other dialog box pages to explore the settings you can configure in a build specification for an installer. For this exercise, do not change the settings onCategory
these dialog box pages.
Click the button to close the dialog box and update the project with the build specification settings. The build specification appears under in theOK Tutorial-Installer Build Specifications
window.Project Explorer
Building and Running the Installer
Save the project. LabVIEW does not save build specifications settings on disk until you save the project.
Right-click the build specificat ion and select from the shortcut menu to build the installer. A dialog box displays the progress of the build. When the dialog box displTutorial-Installer Build
the message, click the button.Installer build complete Done
Navigate to the directory. The directory should contain subdirector ies named , , and , and the files ,AB Tutorial\Installer\Volume bin license supportfiles nidist.id
, and .Setup.exe setup.ini
If you want to run the installer to test the LabVIEW Run-Time Engine installation, copy the files to a computer that does not include LabVIEW and run .Setup.exe
6. Source Distributions
Complete the following steps in each task to configure the source distribution build specification and build the source distribution. Refer to the for the most detailed and up-to-datLabVIEW Help
information about building source distributions. You can access the by selecting in LabVIEW.LabVIEW Help Help»LabVIEW Help
Configuring the Build Specification
From the window, right-click and select from the shortcut menu to display the dialog bProject Explorer Build Specifications New»Source Distribution Source Distribution Properties
Complete the following steps on the page of the dialog box.Information
Enter in the text box. The text box contains the name of the source distribution build specification that appears underTutorial-Dist Build specification name Build Specification
in the window.Project Explorer
8/9/2019 LabVIEW Appliction Builder
http://slidepdf.com/reader/full/labview-appliction-builder 4/44/4 www.ni.c
2.
3.
1.
2.
3.
4.
5.
6.
1.
2.
3.
1.
2.
1.
2.
3.
4.
5.
6.
7.
1.
2.
3.
Click the button next to the text box and navigate to the directory. Create a subdirectory named . Double-click theBrowse Destination directory AB Tutorial Distribution
directory and click the button to select the directory. When you build the source distribution, the files appear in this directory.Distribution Current Folder
From the list on the left, click , which contains settings you can use to specify which files are included and how they are included in the source distribution. CompleteCategory Source Files
the following steps on the dialog box page.
From the tree, click the folder to expand it.Project Files Tutorial Files
Select all of the items in the folder.
Click the button next to the listbox to add the items to the listbox.Add Item Always Included
From the list, select the other dialog box pages to explore the settings you can configure in a build specification for a source distribution. For this exercise, do not change theCategory
settings on these dialog box pages.
From the list, click to display the page. Click the button to view a preview of the files that LabVIEW creates when you build the sourceCategory Preview Preview Generate Preview
distribution. You can use this preview to verify that LabVIEW will create the files you want in the directories you want. You can correct errors before you build the source distribution.
Click the button to close the dialog box and update the project with the build specification settings. The build specification appears under in theOK Tutorial-Dist Build Specifications Pro
window.Explorer Building the Source Distribution
Save the project. LabVIEW does not save build specifications settings on disk until you save the project.
Right-click the build specificat ion and select from the shortcut menu to build the source distribution. A dialog box displays the progress of the build. When the dialog boxTutorial-Dist Build
displays the message, click the button.Build Complete Done
Navigate to the directory. The directory should contain the VIs and support files from the project as well as other internal files that LabVIEW determined thAB Tutorial\Distribution
source distribution needed to include.
7. Zip Files
Complete the following steps in each task to configure the zip file build specification and build the zip file. Refer to the for the most up-to-date information about building zip files.LabVIEW Help
You can access the by selecting in LabVIEW.LabVIEW Help Help»LabVIEW Help
Configuring the Build Specification
From the window, right-click and select from the shortcut menu to display the dialog box.Project Explorer Build Specifications New»Zip File Zip File Properties
Complete the following steps on the page of the dialog box.Zip Information
Enter in the text box. The text box contains the name of the zip file build specification that appears under in theTutorial-Zip Build specification name Build Specifications Proj
window.Explorer
Click the button next to the text box and navigate to the directory. Create a subdirectory named . Double-click the directory. EnterBrowse Destination AB Tutorial Zip Zip
in the file name field and click the button. When you build the zip file, a file with the name you specified appears in the directory you specified.Tutorial.zip Select
From the list on the left, click to display the Source Files page, which contains settings for the files to include in the zip file.Category Source Files
From the page, place a checkmark in the checkbox so the zip file includes all the VIs and support files in the project. This is a faster option than moving fileSource Files Zip entire project
from the tree to the listbox if you want to include all the project items in the zip file.Project Files Included Items
From the list, select the Zip File Structure page other dialog box pages to specify the file structure for a zip file. For this exercise, do not change the settings on this page.Category
Click to display the Preview page. Click the button to view a preview of the compressed file structure that the Application Builder creates when you build the zipPreview Generate Preview
file. You can use this preview to verify that the Application Builder will include the files you want from the directories you want. You can correct errors before you build the zip file. Notice tha
the zip file includes all project items and the project file ( ) itself..lvproj
Click the button to close the dialog box and update the project with the build specification settings. The build specification appears under in theOK Tutorial-Zip Build Specifications Proj
window.Explorer
Building the Zip File
Save the project. LabVIEW does not save build specification settings on disk until you save the project.
Right-click the build specificat ion and select from the shortcut menu to build the zip file. A dialog box displays the progress of the build. When the dialog box displays theTutorial-Zip Build
message, click the button.Build complete Done
Navigate to the directory. The directory should contain the file .AB Tutorial\Zip Tutorial.zip
You can use a standard decompression tool to decompress the zip file and view the VIs and support files it includes.