Documente Academic
Documente Profesional
Documente Cultură
NI LabWindows™/CVI
Introduction to LabWindows™/CVI
Overview
NI LabWindows/CVI is a proven ANSI C development environment for test and measurement that
greatly increases the productivity of engineers and scientists. For more than 20 years, C
developers have used LabWindows/CVI to develop high-performance, stable applications in the
manufacturing test, military and aerospace, telecommunications, design validation, and
automotive industries. LabWindows/CVI streamlines development in these areas with hardware
configuration assistants, built-in measurement libraries, comprehensive debugging tools,
interactive execution capabilities that developers can use to run functions at design time, and
advanced analysis and scientific user interface tools.
Table of Contents
1. Integrated Environment
2. State-of-the-Art Hardware Connectivity
3. Scientific Advanced Analysis
4. Visualize Test and Measurement Data
5. Support for the Latest PC Technologies
6. Multiplatform Support
7. Productive Development Tools
8. NI TestStand Test Management Software Integration
9. Conclusion
www.ni.com
NI LabWindows™/CVI
Integrated Environment
Figure 1. LabWindows/CVI features a streamlined tabbed workspace in which you can quickly
develop, debug, and manage large applications.
The integrated workspace provides an intuitive, convenient interface for creating and managing
large projects. You can also customize each of the areas to fit your specific development style
and preferences, and integrate with source code control, requirements management, and data
management systems.
Often the most critical process in a measurement application is connecting to an instrument and
taking measurements. LabWindows/CVI simplifies the task of connecting to and communicating
with a wide variety of instruments. With the LabWindows/CVI built-in measurement libraries, you
can quickly acquire data from GPIB, USB, serial, Ethernet, PXI, and VXI instruments using the
built-in instrument I/O libraries or using built-in instrument drivers.
www.ni.com
NI LabWindows™/CVI
In addition to the integrated NI-DAQmx data acquisition library, LabWindows/CVI features the
DAQ Assistant, an interactive interface to the NI-DAQmx driver framework. The DAQ Assistant,
shown in Figure 2, interactively defines a measurement task, determines the measurement
capabilities of the data acquisition device you specify, and generates code modules that contain
the acquisition functionality. The tight integration of the DAQ Assistant and NI-DAQmx with
LabWindows/CVI offers engineers who perform data acquisition the most efficient, productive
way to take measurements in an ANSI C environment.
Figure 2. The DAQ Assistant interactively defines a measurement task, determines the
measurement capabilities of the DAQ device you specify, and generates code modules
containing the acquisition functionality.
www.ni.com
NI LabWindows™/CVI
Read more in the “Using the DAQ Assistant in LabWindows/CVI” white paper.
Engineers and scientists in the test industry recognize that easy connectivity to various
instruments from different vendors is crucial when selecting a software package.
LabWindows/CVI, along with NI LabVIEW software, is an industry leader in instrument control
and connectivity through an Instrument Driver Network of more than 6,000 instrument drivers
from more than 275 vendors. You can use these drivers to easily program instrument control
applications. LabWindows/CVI takes instrument control to the next level of productivity with
the Instrument I/O Assistant, with which you can generate code to communicate with devices
such as serial, Ethernet, and GPIB instruments without using an instrument driver.
Figure 3. The LabWindows/CVI Instrument I/O Assistant automatically parses instrument data,
generates reusable code, and interactively defines basic communication.
The Instrument I/O Assistant offers a simple interface you can use to quickly prototype
applications and autoparse instrument data, without any programming. You can easily import the
generated code into any existing application, which removes the tedium of writing instrument
connectivity, basic communication, and string parsing code. By writing two lines of code, you can
invoke more than 300 lines of code created by the Instrument I/O Assistant and quickly focus on
taking measurements.
www.ni.com
NI LabWindows™/CVI
Create professional measurement and automation graphical user interfaces (GUIs) in C without
spending months on development. LabWindows/CVI delivers measurement-specific user
interface components that you can drag, drop, and extend to create a custom interface to your
www.ni.com
NI LabWindows™/CVI
measurement applications. These controls include buttons, knobs, slides, gauges, tanks, dials,
and graphs.
Figure 5. You can create modern user interfaces with updated theme-based controls.
Because industry standards are pushing more open technology, such as multithreading, .NET
XML Web services, and Internet-enabled applications, LabWindows/CVI incorporates these
technologies.
Multicore Programming
Executing tasks in parallel often uncovers design flaws that go unnoticed in single-threaded
applications – especially when correct application behavior depends on the precise timing of
www.ni.com
NI LabWindows™/CVI
execution, memory access, and communication between multiple tasks. LabWindows/CVI not
only provides simplified ANSI C thread synchronization functions and optimized threading
constructs to address these challenges but also contains several advanced features that simplify
troubleshooting and design optimization on multicore systems.
Figure 6. Select a particular CPU from the Highlight CPU Mode option to highlight all thread
activity that executed on that CPU.
Microsoft .NET
With LabWindows/CVI, you can take advantage of the latest Microsoft .NET technologies to
invoke methods and set and get properties from .NET assemblies. The .NET assemblies are the
building blocks of all .NET applications; thus, LabWindows/CVI programmers can use this
functionality to call Web services such as those for sending automated e-mails, accessing rich
database functionality, and interacting directly with Microsoft Windows API methods including
those for viewing CPU use and logging errors.
LabWindows/CVI also includes the Internet Library, which you can use to instantly connect your
applications to the Web through e-mail, FTP, Telnet, and ping. You can send e-mail or text
messages to notify operators of specific events, such as a machine overheating. You also can log
acquired data to an FTP server. In addition, LabWindows/CVI contains an XML function library.
www.ni.com
NI LabWindows™/CVI
The cvixml.fp instrument driver includes functions you can use to create and modify XML
documents.
Multiplatform Support
With the flexibility of LabWindows/CVI, you can protect your code investment by reusing legacy
code in a familiar environment and seamlessly integrate distributed test systems running on
Windows, Linux®, or real-time platforms.
With the LabWindows/CVI Real-Time Module, you can create reliable, deterministic applications
that target dedicated real-time hardware. This module reduces your development time for real-
time applications by helping you:
• Reuse existing ANSI C code and the familiar LabWindows/CVI development environment
• Target commercial off-the-shelf (COTS) hardware targets, specifically PXI and PC
targets, as well as I/O
• Use a single toolchain for real-time and Windows development
The LabWindows/CVI Run-Time Module for Linux extends the LabWindows/CVI development
environment by allowing developers to create high-performance, stable applications on a
Windows system and later compile and run these applications on a Linux target.
LabWindows/CVI also includes key productivity features with which you can efficiently create
end-to-end solutions. Some additional productivity tools include new project and file templates for
easily implementing consistent programming style while reducing the amount of redundant tasks
performed between multiple applications.
It is common for developers on a team to use a consistent code or user interface template when
starting new projects. Common settings such as source code control or build options typically
have to be reset from project to project if development is performed on different machines. With
the new Project Wizard, you can create new project or source files based on existing templates.
The templates can apply to file-naming conventions, code documentation, build and target
options, and user interface design.
Function Panels
Interfacing with an instrument usually requires the constant exploration of header files and help
files. LabWindows/CVI introduced function panels as an easy tool to navigate an API and
interactively insert function calls. Help is available for the function itself and each parameter. In
addition, you can use function panels to interactively run individual functions with parameters that
www.ni.com
NI LabWindows™/CVI
you specified. With function panels, you can quickly write source code in an interactive window,
even automatically inserting ampersand (&) signs before variables to designate memory
addresses. In addition, if you are developing a custom instrument driver, you can use the function
panel HTML generation capabilities to take the documentation already included in your
instrument drivers or in the open source instrument drivers available in function panels and
generate Web-ready documentation that can be easily distributed and searched.
LabWindows/CVI features the Set Next Statement command, which you can use to skip over
code you know is going to fail or investigate code that failed when you executed it. This command
changes the next statement to execute while you are debugging.
LabWindows/CVI includes editable data tooltips. As you debug your application, you can hover
over a variable name in the Source window to view and change the variable value using the
tooltip.
With LabWindows/CVI, you can locate potential resource/memory leaks earlier in the
development process with the Resource Tracking Window. This tool records and tracks all
resources allocated at run time including dynamic memory, file handles, panels, GPIB/TCP
handles, and thread pools. You can also use the tool to easily go to source code, view memory,
break on deallocation, and log tracked resources to disk for later review.
The built-in Resource Tracking Window in LabWindows/CVI 9.0 has saved me days of
adding custom debugging code to track memory and other resource usage. Now with an
integrated solution that requires no changes to my code, I have found multiple memory
leaks in a matter of minutes. This new feature is invaluable. - Chris Quick, Software
Engineer, Laser Technology Inc.
NI TestStand Test Management Software Integration
NI TestStand introduces the latest test management software technology for developing
automated test systems more quickly and effectively. NI TestStand has features specially
designed to develop LabWindows/CVI test systems fast, including a LabWindows/CVI flexible
module adapter and NI TestStand user interface (UI) controls for LabWindows/CVI.
The LabWindows/CVI flexible module adapter ensures maximum return on your software
development investment by increasing code reusability. You now can call functions within any
LabWindows/CVI .c, .obj, .lib, or .dll file regardless of the function prototype. The
LabWindows/CVI flexible module adapter has also been updated to improve parameter
visualization when you configure a module in NI TestStand. These improvements substantially
reduce development times and eliminate unnecessary programming.
www.ni.com
NI LabWindows™/CVI
Figure 7. With the new LabWindows/CVI flexible module adapter, you can call functions within
any LabWindows/CVI file from NI TestStand, regardless of the function prototype.
Conclusion
The proven LabWindows/CVI development environment can make your ANSI C application
development more productive with integrated workspace and development tool enhancements,
more robust hardware functionality, real-time connectivity capabilities, advanced data
management tools, and tight test management integration.
www.ni.com