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

Document Type: Instrumentation Newsletter
NI Supported: No
Publish Date: Jul 2, 2008


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Special Focus: Applying Software Engineering Techniques to LabVIEW Programming

35 ratings | 2.46 out of 5
Read in | Print

For 20 years, National Instruments LabVIEW software has been known as an easy-to-use development tool. In many ways, the simplicity of developing an application with NI LabVIEW has hidden the fact that it is a sophisticated programming language suitable for handling the development of large and complex applications that require structured development approaches. This article examines steps throughout the development process and highlights tools and practices you can use to help you deliver high-quality software.





 

Figure 1. Adding a few simple software development practices to your application can create a repeatable process that results in increased software quality, reduced cost, and decreased development time. In some cases, specific industries require formal processes.



1. Requirements Gathering and Design
The first step in developing software is capturing the requirements, which involves establishing expectations for the software functionality, performance, user interface, and more. You can use several tools – from Microsoft Word to dedicated tools such as Telelogic DOORS – for documenting requirements. If traceability is necessary, you can use NI Requirements Gateway software to report the impact of a requirements change on the corresponding code.

During design, you determine the software framework that best suits the specified requirements and define the individual software components. LabVIEW includes several established design templates that you can use as starting points. These design templates range from simple templates, such as the Single-Loop Application, to complex patterns, such as Producer/Consumer Design Pattern (Events). These design patterns typically have evolved through the efforts of many developers and have been fine-tuned for simplicity, maintainability, and readability. Furthermore, as a pattern gains acceptance, it becomes easier to recognize, and this recognition alone helps other developers to read and make changes to an application.

Designing large applications in LabVIEW is similar to software design in other languages and involves dividing an application into logical pieces of manageable size. When defining application components, the LabVIEW block diagram programming metaphor makes top-down design particularly straightforward and intuitive. You can begin with a top-level block diagram and add the main components of the application – such as VIs for configuration, data acquisition, analysis, data display, logging, and error handling – as empty subVIs with defined inputs and outputs.

Obtain more information on LabVIEW design templates.

2. Development and Testing
Development is the process of translating the design into working code. Employing a modular development approach simplifies managing changes and debugging. Modularity also is important when coordinating teams of developers, in which clearly defined programming responsibilities are necessary. LabVIEW is, by definition, a modular programming language; you can run each VI as a stand-alone application, or subVI.

As an application grows, you may need tools to help manage the files associated with development, such as VIs, documentation, third-party libraries, data files, and hardware configuration settings. In LabVIEW 8, you can use the LabVIEW Project (see Figure 2) to manage your application files, create specifications for stand-alone executables and installers, and deploy code to LabVIEW targets such as real-time embedded controllers.



 

Figure 2. The LabVIEW Project provides a system view so you can organize and manage application files, create build specifications, and deploy or download files to embedded hardware.



When working within a team of developers, you must implement a process to deal with changes and share code. Source code control software provides the best solution for tracking changes to files and controlling access to avoid accidental loss of work. For this reason, LabVIEW interfaces with many industry-standard source code control packages such as Microsoft Visual SourceSafe and IBM Rational ClearCase, providing access to common source control operations from within the LabVIEW environment.

Testing is essential to successful software development. As you define your requirements at the beginning of a project, it is important to simultaneously plan how you will verify that the software and all its components function correctly. LabVIEW makes it easy to automate much of the testing process – if a VI has input and output terminals on its connector pane, another VI can call the VI under test as a subVI and pass it a variety of data while checking the results.

Obtain more information on the LabVIEW Project and source code control.

3. Software Distribution and Summary
At the conclusion of development, you must deliver finished, stand-alone software in the form of an executable or DLL. The LabVIEW Application Builder provides the functionality to build repeatable executables, DLLs, source code distributions, and zip files. You also can use the LabVIEW Application Builder to create Windows installers that provide your user with a straightforward installation experience. Installers bundle executables and DLLs with NI hardware drivers, documentation, licenses, and configuration files in a single package.



[+] Enlarge Image

Figure 3. With the LabVIEW Application Builder, you can quickly and easily create
stand-alone executables, DLLs, source distributions, and installers.



To maximize success when using LabVIEW to create large, complex applications, you can add elements of structured software development to projects involving LabVIEW to help ensure consistency and improve overall code quality.

Michael Neal
LabVIEW Product Marketing Engineer
michael.neal@ni.com

Obtain more information about the NI Requirements Gateway.

This article first appeared in the Q2 2006 issue of Instrumentation Newsletter.


35 ratings | 2.46 out of 5
Read in | Print

Reader Comments | Submit a comment »

 

Legal
This material is protected under the copyright laws of the U.S. and other countries and any uses not in conformity with the copyright laws are prohibited, including but not limited to reproduction, DOWNLOADING, duplication, adaptation and transmission or broadcast by any media, devices or processes.