Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Example Program
NI Supported: Yes
Publish Date: Jun 3, 2008


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Programmatically Build Applications in LabVIEW

0 ratings | 0.00 out of 5
Print

Overview

This article is part of a series on software engineering practices and tools for large application development in LabVIEW.

Click here to view the list of other articles


This example shows how to batch build several distributions in LabVIEW using a programmatic build process.

Downloads

Filename: programmaticbuild2.vi
Requirements: View

Introduction

Many applications require frequent compilation into an executable (.exe) or a dynamic link library (.dll). An application might require building the source code into an executable every night or every ten minutes. Prior to LabVIEW 8.0 the application builder required the creation of a unique *.bld file to correspond to every configuration your application required. You could then call that file from a batch file.

When the LabVIEW project was introduced in LabVIEW 8.0, build specifications were integrated into the project. To provide the previous capability of batch compilation, LabVIEW now provides a VI called BuildTargetBuildSpecification.vi that programmatically builds a distribution using a predefined build specification. This example shows how to use that feature to batch build applications from the command line. This enables you to build applications from a task automation program such as Windows Task Scheduler.

Details of the example

The example programmaticbuild.vi shows how to programmatically build several projects using command line arguments.  Using the BuildTargetBuildSpecification.vi (which is packaged with the LabVIEW Application Builder), this example simply iterates through the command line arguments and uses BuildTargetBuildSpecification.vi as a subVI to build projects according to their specified build specifications.  Any LabVIEW version 8.0 or later with Application Builder installed has this function available in <LabVIEW directory>\vi.lib\AppBuilder.

To run this example, open a command line window. Browse to the LabVIEW directory, and enter the following line in the command line window:

labview.exe “<Location of programmaticbuild.vi>” -- “<Project 1>.lvproj” “<Project 2>.lvproj” “<Project 3>.lvproj” <…> “<Project n>.lvproj”

This example is configured to run automatically when the VI opens so that the projects can be built from the command line window. You can implement this process into any batch processing system that is set up (such as Windows Task Scheduler) by configuring the batch program to call labview.exe with the previous arguments.

This example include a built-in error logger that writes the file error_log.txt to the temporary directory specified in the Options dialog box. This log displays information about the build process. Select Tools»Options to display the Options dialog box, and select Paths from the Category list to configure the temporary directory. You can edit the build process used in this example. Additionally, the example contains a sequence structure that closes LabVIEW when the VI finishes executing, depending on the value of the Boolean constant.

Requirements


Filename: programmaticbuild2.vi

Software Requirements


Application Software: LabVIEW Base Development System 8.0
Toolkits and Add-Ons: LabVIEW Application Builder 1.0

 
0 ratings | 0.00 out of 5
Print

Reader Comments | Submit a comment »

 

Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).