Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Developing and Distributing an Application

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

Requires: Application Builder or Professional Development System

You can convert a LabVIEW project into a distributable application for use on other computers and from other programming languages. Complete the steps in this document to create any of the following types of distributable applications:

  • Stand-alone applications
  • Installers
  • .NET interop assemblies
  • Packed project libraries
  • Shared libraries
  • Source distributions
  • Zip files

Preparing to Build the Application

  1. Open the LabVIEW project from which you want to build the application.

    You must build an application from a project, rather than from an individual VI.
  2. Save the entire project to ensure that all VIs are saved in the current version of LabVIEW.
  3. Verify the settings in the VI Properties dialog box for each VI.

    If you plan to distribute your application, ensure that the settings in the VI Properties dialog box are accurate for the built version of your VIs. For example, to polish the appearance of your built application, verify the settings on the following pages of the VI Properties dialog box:
    Note If your application contains VIs with separate compiled code, you can configure settings for those VIs on the Source Files Settings page of the Properties dialog box for your application.
  4. Verify that the paths used in the development environment still behave correctly on destination computers.

    If the project loads VIs dynamically, use relative paths, instead of absolute paths, to specify the location of the VI. Because file hierarchies can vary on different computers, relative paths ensure that paths function correctly in both the development environment and the destination computers on which the application runs.
    Note If your application uses the 8.x file layout, you may need to use a different relative path on the destination computer from the relative path in the development environment.


    Also, to avoid receiving an error during the build process, ensure that the file paths for the destination directory, including the filename, generated for the build are less than 255 characters. You can specify the destination for the generated files on the Destinations page of the properties dialog box for the build specification you are creating.
  5. Verify that the Current VI's Path function returns the path you expect.

    In a stand-alone application or shared library, the Current VI's Path function returns the path to the VI in the application file and treats the application file as an LLB.

    For example, if you build foo.vi into an application, the function returns a path of C:\..\Application.exe\foo.vi, where C:\..\Application.exe represents the path to the application and its filename.
  6. Ensure that VI Server properties and methods work as expected in the LabVIEW Run-Time Engine.

    The LabVIEW Run-Time Engine does not support some VI Server properties and methods. Therefore, avoid using these properties and methods in the VIs that you include in an application or shared library.

    You can run the Built Application Compatibility test from the VI Analyzer Toolkit to ensure that your VI Server properties are compatible with the LabVIEW Run-Time Engine.
  7. If a VI includes MathScript Node, remove any unsupported functions from your scripts.

    (MathScript RT Module) The LabVIEW Run-Time Engine does not support certain MathScript RT Module functions. If a VI includes a MathScript Node, remove any unsupported functions from your scripts. (MathScript RT Module, Windows) If a VI includes a MathScript Node that calls functions from the libraries class, add the DLL and the header file to the project before you create or edit a build specification. Also, make sure that the paths to these files are correct in the application.

Configuring Specifications for a Built Application

Note If you save a custom run-time menu for a front panel control as a separate run-time menu file, or .rtm file, and want to include this control in an application build, you must add the .rtm file to the Always Included listbox on Source Files page of the Properties dialog box for your application.
  1. Create the build specification.

    Expand My Computer in the Project Explorer window. Right-click Build Specifications and select New»your application type from the shortcut menu to display the Properties dialog box for your application. If you previously hid Build Specifications in the Project Explorer window, you must display the item again to access it.
  2. From the Properties dialog box for your application, configure the required pages of the build specification.
    Note If you want to include any type of application within an installer, make sure to specify that all the files in the application are relative to the primary destination of the application. Otherwise, when you include the build output of the application within an installer, the installer will reorganize the original file organization of the application by moving all files that are not relative into the primary destination. You can specify the primary destination for any type of application on the Destination page of the Properties dialog box for the application.


    Choose the type of application you want to build from the following list:

    If you have the .NET Framework 4.0 installed on your development computer, you can use the Application Builder to build a .NET interop assembly.

    • Required Configurations
    • Recommended Configurations
    • Additional Information
      • If you select the Zip entire project option from the Source Files page of the Zip File Properties dialog box, LabVIEW does not automatically include outputs from other build specifications in the Included Items tree. You must use the arrow buttons to add a source distribution, shared library, or application to the zip file.
      • Outputs of zip or installer build specifications do not appear in the Project Files tree on the Source Files page. To include another zip file or installer in the zip file, add the zip file or installer you want to include to the LabVIEW project under the target from which you are building the zip file.
      • You can use the Zip VIs or the Build VI to build zip files programmatically. To use the Zip VIs, you must know the relative path for every file you want to include in the zip file.
  3. Explicitly include dynamically loaded VIs in the build specification.

    If a VI loads other VIs dynamically using the VI Server or calls a dynamically loaded VI through a Call By Reference or Start Asynchronous Call node, you must add those VIs to the Always Included listbox on the Source Files page of the Properties dialog box for your application.



    You also can distribute dynamically loaded VIs for an application by including them within a source distribution.
  4. If the hardware target for your application does not support SSE2 instructions, disable the SSE2 compiler optimizations.

    By default, the Application Builder configures new build specifications to include SSE2 compiler optimizations that improve the run-time performance of distributed VIs and built applications. To build a LabVIEW application that runs on a hardware target that does not support SSE2 instructions, disable the SSE2 compiler optimizations before building the target. Otherwise, LabVIEW returns an error when the application runs on the target. To disable the compiler optimizations for your application, remove the checkmark from the Enable SSE2 optimizations checkbox on the Advanced page of the properties dialog box for the application.
  5. Save the updated settings for your build specification.

    Click the OK button to update the build specification in the project and close the dialog box. The build specification name appears in the project under Build Specifications.

    To save changes you make to a build specification, you must save the project that contains the build specification.

Building the Application

Right-click the build specification name for the application you want to build, and select Build from the shortcut menu. You also can build an application programmatically using the Build VI.

Tip  You can preview your application to ensure that it appears correctly. From the Preview page of the Properties dialog box for your application, click the Generate Preview button to review the generated files for your application.

Distributing the Built Application

Note Although you can build any type of basic application on a target that runs the Windows Embedded Standard operating system, you cannot use the LabVIEW Project Explorer window to deploy any type of application to a target that runs this operating system. To deploy any type of application to a target that runs Windows Embedded Standard, you must copy the application files from the development computer to the target.
  1. Ensure that the computer on which you want to run the application has access to the LabVIEW Run-Time Engine.

    The LabVIEW Run-Time Engine must be installed on any computer on which users run an application or shared library. You can distribute the LabVIEW Run-Time Engine with the application or shared library. (Windows) You also can include the LabVIEW Run-Time Engine in an installer.
  2. Distribute legal information for your end user.

    If you use installers to distribute your applications, enter information for a custom license agreement on the Dialog Information page of the Installer Properties dialog box.

    Review <National Instruments>\Legal Information.txt for information about including legal information in installers built with NI products.
  3. Refer to the following table for tips to assist you with distributing LabVIEW-built applications.
    ActionBenefit
    To verify that the built application performs correctly, enable debugging by placing a checkmark in the Enable Debugging checkbox on the Advanced page of the Properties dialog box for your application. You also can connect to a built application by selecting Operate»Debug Application or Shared Library.When you test a built application, you ensure that behavior did not change between the development environment and the distribution environment.
    After you test your application, disable debugging for your VIs.Disabling debugging for VIs can reduce file size and increase run-time performance.
    Create an About dialog box for a stand-alone application. Most professional applications include an About dialog box that provides general information about the application, such as version, copyright, and support information.
    If your end user has spoken language requirements that differ from the language of the original application, adjust the default language settings for the application on the Run-Time Languages page of the Properties dialog box for your application.When you distribute an application, dialog boxes and menus adopt the spoken language of the operating system on which the application runs, but the text and controls you implement remain in the language of the operating system on which you originally built the application.

    By default, stand-alone application and shared library build specifications provide support for Chinese (Simplified), English, French, German, Japanese, and Korean.

    If your application uses the same VI Server port as another application, create a custom configuration file. If you try to run an application that requires the VI Server at the same time as the conflicting application, the VI Server does not run, and LabVIEW does not provide a warning.
    Distribute a custom configuration file along with your built application.If you need to ensure that the application always runs under certain LabVIEW environment settings, you can preserve and redistribute those settings by distributing a custom configuration file, or preference file, with your application.

 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit