Build on the Latest Technologies with LabWindows/CVI 2015

Publish Date: Aug 03, 2015 | 3 Ratings | 4.67 out of 5 | Print


Building on the latest improvements to the new LabWindows/CVI optimizing compiler, LabWindows/CVI 2015 includes version 3.3 of Clang, the C language compiler front end to the LLVM compiler infrastructure. First introduced in LabWindows/CVI 2013, LLVM is an industry standard compiler infrastructure, that offers programmers optimized code generation out of the box. The upgrade to Clang 3.3 helps developers ensure code reliability by highlighting weak points with added error and warning messages.

As a stability release, LabWindows/CVI 2015 contains over 50 bug fixes and improvements to provide a robust development platform for building critical applications for test and measurement. Programmers can take advantage of all the new features introduced in LabWindows/CVI 2013 such as OpenMP and Network Streams to improve application performance without significantly rewriting their code. By providing the latest compiler and parallel programming technologies, LabWindows/CVI 2015 lets developers focus on program logic and I/O.

Download LabWindows/CVI 2015 and take advantage of the latest features:

Improved Code Performance

  • Generate code that runs up to 60% faster with the new industry standard optimizing compiler
  • Use the portable and scalable OpenMP API to easily parallelize existing code
  • Efficiently stream data between networked applications with the lossless Network Streams API
  • Use the new Advanced TDMS functions to implement high-performance data streaming to disk

Increased Productivity

  • Edit your code while compiling source files
  • Build multiple files in parallel and see faster build times overall on multicore systems
  • Attach and detach the debugger to a running process for debugging
  • Navigate source files with ease using a function pull-down list and improved browsing
  • Create cleaner code with batch formatting and auto-indentation

Table of Contents

  1. Execution Optimizing Compiler
  2. Flexible Multithreading with OpenMP
  3. Lossless, Networked Data Streaming
  4. High Performance Data Streaming to Disk
  5. Powerful Build System
  6. Powerful Source Code Browsing
  7. Batch Formatting and Auto Indenting Code 
  8. Support for Soft Dependencies in Distributions

Improve the Performance of Your Code

1. Execution Optimizing Compiler

As of LabWindows/CVI 2013, the compiler uses the LLVM compiler infrastructure with a Clang C front end. This compiler generates optimized code, meaning that you no longer need to use an external optimizing compiler for this purpose.

Clang was selected as a basis for the LabWindows/CVI compiler because it can deliver amazingly fast compiles, extremely useful error and warning messages, and up to 60% faster execution speeds than the previous LabWindows/CVI compiler. Developers performing complex computation, mathematics, or analysis will see the highest performance gains because the compiler backend is particularly suited for optimizing resources used in mathematical calculations.

LLVM and Clang began as research project out of the University of Illinois, with the goal of providing a modern, SSA-based compilation strategy capable of supporting both static and dynamic compilation of arbitrary programming languages [1]. Since then, LLVM has grown to include a number of subprojects, many of which are being used in production by a wide variety of commercial software vendors such as Apple Inc., Intel, AutoESL, NVIDIA, and National Instruments. To learn more, visit

Developers can also show or hide warning levels based on a customized list of warning level types, which makes it easier to find warnings of interest, focus on errors, and debug more effectively. To access the Compiler Warnings dialog box, right-click in the Build Output window and select Configure Warnings.

Fig 1. Customize levels and types of warnings displayed in the Build Output window.


Back to Top

2. Flexible Multithreading with OpenMP

The portable and scalable OpenMP API makes it easy to parallelize existing code without significant edits. OpenMP (Open Multi-Processing), is a set of compiler directives and related clauses, an application programming interface (API), and environment variables that allow you to easily create applications that execute on multiple threads. The OpenMP model allows you to complete the following tasks:

  • Define parallel regions of code and create teams of threads that execute the parallel regions.
  • Specify how to share work (loop iterations) among the threads in a team.
  • Declare data that is shared among the threads and data that is private to each thread.
  • Synchronize threads, protect shared data from concurrent access, and define regions that execute by a single thread exclusively.

Specific Uses for OpenMP

OpenMP is appropriate to use in a program that consists of tight loops where the loop iterations are independent of each other so that subsets of iterations can run in parallel on multiple processing cores. It is also useful when several regions of the program can run independently of each other but must synchronize at some point, making it a good candidate for the fork/join parallelization design pattern.

While you can use the LabWindows/CVI Utility Library to create multithreaded applications, there are many benefits to using the OpenMP model. Through inserting single-line pragma directives as shown in the figure below, it is possible to implement OpenMP incrementally within existing code, with minimal rewriting of the application. This also enables developers to preserve the sequential order of the original source code and requires minimal retesting after OpenMP directives are added because the program, data structures, and algorithms do not change. It is also easy to compile and test the serial version of the program by disabling OpenMP support in the Build Options dialog box.

The structured approach of OpenMP helps minimize possible programming errors common to multithreaded programming as it does not require use of low-level multithreading constructs and objects. All the underlying implementation is handled by OpenMP, allowing developers to focus on application logic and I/O.  

In addition, porting code to other compilers and operating systems is simplified because compilers that do not support the OpenMP structure will ignore the OpenMP compiler directives. Performance can even be adjusted at run time through the availability of environment variables to adjust loop scheduling at run time without touching the source code. Note: LabWindows/CVI 2015 is compliant with the OpenMP 2.5 Specification.

Fig 2. The OpenMP API is integrated into the LabWindows/CVI Library Tree. You must enable OpenMP by selecting Enable OpenMP support in the Build Options dialog box.

Back to Top

3. Lossless, Networked Data Streaming

The Network Streams API provides lossless, unidirectional, one-to-one communication channel between distributed LabWindows/CVI or LabVIEW applications. Using network streams, you can easily share data across the network or on the same computer.

Network streams are an easy-to-configure, tightly integrated, and dynamic communication method for transferring data from one application to another with throughput and latency characteristics that are comparable with TCP. Network streams also have enhanced connection management that automatically restores network connectivity if a disconnection occurs due to a network outage or other system failure.  Streams use a buffered, lossless communication strategy that ensures data written to the stream is never lost, even in environments that have intermittent network connectivity.

Fig 3. Network streams provide a protocol and API for sending measurement data across networked applications without losing any data points.

Specific Uses for Network Streams

Network streams were designed and optimized for lossless, high throughput data communication.  Network streams use a one-way, point-to-point buffered communication model to transmit data between applications.  This means that one of the endpoints is the writer of data and the other is the reader.  You can accomplish bidirectional communication by using two streams, where each computer contains a reader and a writer that is paired to a writer and reader on the opposite computer.

Because streams were built with throughput characteristics comparable to those of raw TCP, streams are ideal for high throughput applications where the programmer wants to avoid the complexity of using TCP.  Streams can also be used for lossless, low throughput communication such as sending and receiving commands.  However, using streams for low throughput communication may require more explicit management over when data is transmitted through the stream if the absolute lowest latency is desired.


Back to Top

4. High Performance Data Streaming to Disk

The NI Technical Data Management Streaming (TDMS) file format is the fastest and most flexible way to store measurement data to disk. Developers have long used the LabWindows/CVI TDMS API to attach timing information and custom-defined attributes to measurement data as it streams to disk. Storing data in TDMS files eliminates the need to design and maintain custom data file formats while creating well documented data sets that can be easily searched and ported to any platform.

Fig 4. Write measurement data to a TDMS file using the built-in libraries to better organize data sets by group and add descriptive meta-data about each data set.

Increase Your Productivity

Back to Top

5. Powerful Build System

The LabWindows/CVI build experience is designed to reduce the duration spent waiting for builds to complete and enable developers to continue making code edits while projects build in the background. The build system is optimized for faster build times and projects with multiple independent source files  build in parallel to better take advantage of multicore processors.


Back to Top

6. Powerful Source Code Browsing

LabWindows/CVI offers a rich programming experience that provides users with intuitive control, navigation, and knowledge of their source files. Programmers can view and jump to functions in a source file by using a pull-down list in the toolbar of the Source window.

In addition, source code browse information can be generated while editing a file so that developers can immediately navigate code while programming without the need to compile first. This option is global to the LabWindows/CVI environment and source code browse information is available in release and debug configurations.

Fig 5 . Source code navigation is made easier through the function pull-down list in the LabWindows/CVI toolbar.

Back to Top

7. Batch Formatting and Auto Indenting Code 

To help developers create cleaner, more readable code, LabWindows/CVI provides customizable batch formatting and auto-indentation tools. Select Options»Editor Preferences and then click the Formatting Options button to specify bracket style and indent options. For consistency, developers can choose from common indentation and bracket placement styles and use the preview windows to see an example of their customized format selections. To auto-indent specified lines, select lines of text in the Source window, and select Edit»Format Selection. To auto-indent an entire file, select Edit»Format File.

Fig 6. Automatic code formatting lets developers focus on program logic without spending time styling source code for readability.

Back to Top

8. Support for Soft Dependencies in Distributions

When creating a distribution, developers can select or omit soft dependencies for any National Instruments installer components that include soft dependencies. A soft dependency of a product refers to a component that might or might not be required by the product depending on the specific needs of your application. Use the Drivers & Components tab of the Edit Installer dialog box to include soft dependencies.


Additional Resources




Back to Top

Bookmark & Share


Rate this document

Answered Your Question?
Yes No