LabVIEW: Ease of Use AND Powerful Development

Publish Date: Sep 06, 2006 | 72 Ratings | 3.38 out of 5 |  PDF

Overview

National Instruments LabVIEW bridges the gap between powerful and flexible programming languages and the ease-of-use of configuration-based tools. LabVIEW provides an intuitive graphical development environment that effectively defeats the idea that a tool cannot be both powerful and easy-to-use. LabVIEW includes features that make it the ideal tool for creating test, measurement, automation, and control applications regardless of industry, area of expertise, or programming experience. Whether you are a scientist, engineer, or technician, LabVIEW provides the appropriate interface depending on your programming expertise, so you can quickly build systems that help validate your product designs, and automate or control processes.You can interactively configure the functions in LabVIEW, and immediately view the results without having to build a finished application. Also, given that LabVIEW is built on the solid foundation of a fully-featured programming language, you can at any point take advantage of powerful programming elements and structures that are completely user-customizable.

Table of Contents

  1. Introduction
  2. Learning LabVIEW is Point-and-Click Easy
  3. LabVIEW is a Fully-Featured Programming Language
  4. LabVIEW Is Designed for Scientists and Engineers
  5. Conclusion

1. Introduction

When developing measurement, automation, and control applications, you have a choice between different classes of software. One class includes traditional programming languages such as C, C++, and Visual Basic. With these typically text-based languages, maximizing the efficiency and the advantages that they offer requires knowledge of available functions, syntactic rules, and the many peculiarities of the development environment. Although these tools are very flexible and scalable, they are typically meant for users who have had some degree of formal training.

The other common class of tools encompasses configuration-based software, which is designed to overcome the inherent difficulties of programming languages by providing an easy and quick way to create automated test and measurement systems. Generally, these are dialog-based interactive applications that offer a set of limited functionality, with little or no possibility for customization or extensibility.

Choosing one class of tools over the other implies making tradeoffs. When using configuration-based tools, you quickly run into inherent barriers as soon as you try to accomplish tasks that lie outside of the built-in capabilities of the tool. With traditional programming languages, you encounter a steep learning curve and nonintuitive text commands for even the simplest tasks.

National Instruments LabVIEW bridges the gap between these two classes of tools by providing an intuitive graphical development environment that effectively defeats the idea that a tool cannot be both powerful and easy to use. LabVIEW includes features that make it the ideal tool for creating test, measurement, automation, and control applications regardless of industry, area of expertise, or programming experience. Whether you are a scientist, engineer, or technician, LabVIEW provides the appropriate interface to match your programming expertise. You can quickly build systems that help validate your product designs, and automate or control processes. You can interactively configure the functions in LabVIEW, and immediately view the results without having to build a finished
application. Also, given that LabVIEW is built on the solid foundation of a full-featured programming language, you can at any point take advantage of powerful programming elements and structures that are completely user customizable.



Figure 1. LabVIEW bridges the gap between powerful and easy-to-use

Back to Top

2. Learning LabVIEW is Point-and-Click Easy

LabVIEW is a development environment based on a graphical programming language. This approach to developing applications significantly reduces the learning curve because
graphical representations are a more natural design notation for engineers and scientists than text-based code. You can access the tools and functions through interactive palettes, dialogs, menus, and hundreds of function blocks, known as virtual instruments (VIs). You can drag and drop these VIs onto a diagram to define the behavior of your applications. This point-and-click approach significantly reduces the time it takes to get from initial setup to a final solution.

Each VI consists of two items: a block diagram and a front panel. The front panel is the graphical user interface where the user of your application can enter commands, values, and manipulate objects such as knobs and buttons to control the application. The front panel is also where results from the execution of the application are presented through indicators, charts, and many other graphical displays. Building a front panel is just as easy as building a block diagram. You can drop objects, which in turn create terminals in the block diagram. You can then wire data in or out of these objects, and pass it back and forth between the front panel and the code in the block diagram.

By navigating through function palettes, you quickly acquire knowledge and confidence and can take advantage of the help dialogs, which clearly explain the configuration parameters and functionality of each VI. Using these VIs, you can describe a high-level sequence of actions that define your application.


Figure 2. LabVIEW Virtual Instrument User Interface - Front Panel with Controls Palette



Figure 3. LabVIEW Block Diagram with Functions Palette

You define the flow of data and the execution of the application through a concept known as dataflow programming. Data is passed from one VI to the next, eventually defining the execution order and functionality of the entire application. Dataflow is comparable in nature to reading a flow chart. Block diagrams consist of functions, which are represented by icons, wires that connect these icons, and structures that control execution logic. Data flows from one function to the next, and the functions and VIs do not execute until all terminals or wire connections have data available for processing.


Figure 4. LabVIEW VI diagram objects use dataflow to determine execution order

There are two types of VIs – standard VIs and Express VIs. With standard VIs you can do everything that LabVIEW offers, from low-level primitives such as add or subtract to high-level functions such as data acquisition, analysis, measurements, and report generation. To configure a standard VI, you wire values and parameters to its terminals, which are then read into the function as the program executes.

Express VIs are comprised of commonly used functions, easily configured with an interactive customized dialog for each VI. As you drop an Express VI into the diagram, a window opens where you can select each of the parameters of the function and immediately visualize the result. LabVIEW then takes the interactively configured settings and automatically creates the underlying code, which you would otherwise create if you were using standard VIs. Some Express VIs provide access to I/O Assistants, extending their interactive interface to configure tasks such as data acquisition (DAQ Assistant) or instrument control (Instrument I/O Assistant).

Express VIs now also simplify the configuration of Modular Instruments such as Signal Generators, High-Speed Digitizers, and Digital Waveform Generator/Analyzers. Before Express VIs, each Modular Instrument required understanding a specific set of functions designed specifically for that instrument. Express VIs make the configuration process easier by showing a custom dialog for each instrument where you can configure all settings by means of inputs and controls that are typically associated with the type of instrument.

Here is a list of Express VIs currently available:
• Align and Resample
• Amplitude and Level Measurements
• Append Signals
• Build Table
• Build Text
• Build XY Graph
• Collector
• Comparison
• Convolution and Correlation
• Curve Fitting
• DAQ Assistant
• Delay Values
• Display Message to User
• Distortion Measurements
• Elapsed Time
• Extract Portion of Signal
• FieldPoint™ Express VI
• Filter
• Formula
• Histogram
• Instrument I/O Assistant
• Mask and Limit Testing
• NI DIAdem™ Report Wizard
• Prompt User for Input
• Read LabVIEW Measurement File
• Relay
• Repack Values
• Report
• Sample Compression
• Scaling and Mapping
• Select Signals
• Simulate Arbitrary Signal
• Simulate Signal
• Spectral Measurements
• Statistics
• Time Delay
• Time Domain Math
• Timing and Transition Measurements
• Tone Measurements
• Trigger and Gate
• Write LabVIEW Measurement File


Figure 5. Configuration Dialog for the Spectral Measurements Express VI


Developing large applications based on a hierarchical architecture provides encapsulation and modularity, and is therefore easier to expand and maintain. This process involves designing individual VIs that performs specific functions. A VI that performs a specific function in another VI is called a subVI or module. In a well-designed VI, each module fulfills one goal or function. If a single module tries to fulfill more than one goal, it can easily become cluttered and hard to maintain. It is good development style in any programming language to create a good module hierarchy, and the graphical nature of LabVIEW makes the hierarchy and the code easier to understand.

Figure 6. Objects are represented in the Front Panel and Block Diagram
During development, you can rely on help tools that make programming and understanding of the environment an easy task. LabVIEW includes help windows that describe any function or item that you point at, as well as tip strips that describe the usage and values of function inputs and outputs. These tools make the development environment even more efficient and shorten the time it takes to create an application.

LabVIEW virtual instruments, by virtue of their graphical nature, are self-documenting. You can print out a diagram, and easily understand its functionality by following the wires that connect the functions together. In addition, you can create more thorough documentation by using built-in documentation options. These automatic tools produce documents that include a list of all functions used, data types, user interface, block diagrams, and a VI hierarchy.



You can easily implement encapsulation and modularity in LabVIEW by bundling together a number of VIs. You can then use these VIs as a unit. These are referred to as subVIs. Through this feature you define a hierarchy, which makes LabVIEW programs easy to maintain and understand.

Each VI consists of two items: a block diagram and a front panel. The front panel is the graphical user interface where the user of your application can enter commands, values, and manipulate objects such as knobs and buttons to control the application. The front panel is also where results from the execution of the application are presented through indicators, charts, and many other graphical displays. Building a front panel is just as easy as building a block diagram. You can drop objects, which in turn create terminals in the block diagram. You can then wire data in or out of these objects, and pass it back and forth between the front panel and the code in the block diagram.



During development, you can rely on help tools that make programming and understanding of the environment an easy task. LabVIEW includes help windows that adapt and describe the functionality of any function or item that you point at as well as tip strips which describe the usage and values of inputs and outputs of each function. These tools make the development environment even more efficient and shorten the time it takes to create an application.

LabVIEW virtual instruments, by virtue of their graphical nature, are self-documenting. You can print out a diagram, and easily understand its functionality by following the wires that connect the functions together. In addition, you can create more thorough documentation by using built-in documentation options. These automatic tools produce documents that include a list of all functions used, data types, user interface, block diagrams, and a VI hierarchy.

Figure 7. Automatically Generated Documentation

Powerful debugging tools provide means to visually trace the execution of the program and view the data passed from one function to another along these wires. Execution highlighting helps you understand the behavior of your application, and even see the data as it flows through the wires. This tool is complemented by probes that show the data flowing through any point of the diagram in a separate floating window during execution. You can use the probes provided or create your own custom probes that will display the data in whatever form you require.

Debugging is also essential for real-time applications. While the LabVIEW Real-Time environment facilitates the development of a real-time system, it is also important to be able to verify its execution. With the new LabVIEW Execution Trace Toolkit, you can now verify the performance of your real-time system and identify less than optimal code execution and difficult-to-find race conditions. With minor LabVIEW code modifications, you can analyze the code execution on a variety of targets such as real-time PXI controllers, Compact FieldPoint systems, and PCI-7041 plug-in boards.

The functionality of the Execution Trace Toolkit has been simplified into five additional VIs that control the functionality of the trace. With these VIs, you can start and stop the trace activity at specific locations, log the trace data to disk, or send it over the network to a host. The toolkit includes an interactive display that shows code execution by thread as well as by VI.

Figure 8. Original Signal Processing VI Figure 9. Signal Processing VI with Trace Tool


In Figure 8, we show an example Signal Processing.vi that has two parallel loops that average and filter data. Averaging the data takes less bandwidth and therefore the application averages data every millisecond. Filtering determines the peak frequency and executes only once every 3 ms. To analyze the execution with the Execution Trace Toolkit, we will add the TraceTool Start Trace.vi and TraceTool Stop Trace and Send.vi as shown in Figure 9.

With these additional VIs you can view the execution with the LabVIEW Trace Execution Tool.

Figure 10 shows a diagram with the execution of Signal Processing.vi. From this diagram you can see that the execution of the Average Data.vi happens three times as often as the Peak Detection.vi.

Figure 10. Execution of Signal Processing.vi

In addition, the LabVIEW Execution Trace Toolkit includes functionality to store the trace to the local hard drive on the real-time target. You can also flag individual events with TraceTool Log User Event.vi.

Back to Top

3. LabVIEW is a Fully-Featured Programming Language


All of the ease-of-use features that LabVIEW offers do not require sacrificing functionality or power. It has the complete functionality of a general-purpose programming language including data structures, decision-making capabilities and flow control, looping structures, and event handlers. The advantage of using LabVIEW is that it reduces the complexity of using these tools through intuitive configuration interfaces and by hiding inherent programming nuances.

One example of how LabVIEW reduces programming complexity is memory management. LabVIEW performs all memory management automatically and ensures that it is used efficiently and safely. Even the data types on the diagram are easy to use. You can create memory strings and arrays, and operate on them without worrying about the details of memory allocation, which means that the potential for a whole host of errors, such as losing or overwriting memory, does not exist.

Another example is event handling. With LabVIEW, you can list all possible events to which the application should respond and programmatically enable or disable a set of events depending on the state of application, thereby significantly increasing efficiency.

This efficiency is achieved through a graphical event structure and an interactive configuration dialog, where you quickly choose the objects and events that you want your application to act upon.

Figure 11. Event configuration dialog and event structure


Traditional programming languages require extensive knowledge of programming techniques to create processes that execute in parallel, a common way of maximizing the efficiency of programs. Implementation of parallelism often requires a complex balance of library calls to operating system functions, resource management, memory protection, and locking mechanisms. LabVIEW makes the implementation of such advanced programming techniques very simple.

Dataflow, which provides a much richer computational model than the flow control of popular text-based languages, is inherently parallel. You can easily achieve parallelism by simply drawing two or more loops. Each of them will automatically execute in parallel and independently from others as long as there are no data dependencies. Even novice users can design a parallel application. In addition, LabVIEW can automatically and transparently spread processing tasks over multiple processors, efficiently making use of all available resources.

High-end versions of the Intel Pentium 4 (and later) processors feature Hyperthreading, which enables applications to get most of the benefits of a multiprocessor machine from a machine with only one processor. Simply put, a hyperthreaded processor acts like multiple processors that are embedded in the same microchip. In other traditional programming languages such as C, in order to make your application multithreaded you have to fork multiple threads and code your own method for communication between threads. In LabVIEW, the execution system is already designed to take advantage of this capability and can automatically recognize opportunities for multithreading if the code demands it (see Figure 12).

Figure 12. Parallel Execution of Code in LabVIEW - Two While Loops


Another example that traditionally requires extensive knowledge of programming technniques is creating processes that execute in parallel, which is a common way of maximizing the efficiency of programs. Implementation of parallelism often requires a complex balance of library calls to operating system functions, resource management, memory protection and locking mechanisms. LabVIEW makes the implementation of such advanced programming techniques very simple. Dataflow, which provides a much richer computational model than the flow control of popular text-based languages, is inherently parallel. You can easily achieve parallelism by simply drawing two or more loops. Each of them will automatically execute in parallel and independently from the others as long as there are no data dependencies. Even novice users can design a parallel application. In addition, LabVIEW automatically and transparently spreads processing tasks over multiple processors, efficiently making use of all available resources. This is an automatic and transparent process, no matter what your programming experience might be.

When creating programs and applications ranging from monitoring and control to real-time simulation of physical systems, personal computers do not always provide the best platform. There is an increasing need to target different devices and embed applications, depending on whether you need faster execution, determinism, or portability. This usually implies learning a new set of instructions and functions and even an entirely different development environment. Typically vendors provide the appropriate set of tools to program a device, as is the case with Microsoft Pocket PC or Palm OS-based PDAs, systems based on real-time operating systems, or VHDL for FPGAs (Field Programmable Gate Arrays). LabVIEW offers an integrated alternative, where you can target many different devices without the need to learn a new development environment. For example, you simply create your application in LabVIEW and download it to a PDA for applications such as handheld monitoring devices or portable data acquisition.

For applications that require real-time data acquisition and control, specifically applications requiring deterministic, real-time control loops, you can download a LabVIEW application onto real-time operating systems running on embedded controllers with a variety of PXI plug-in modules. You can combine these with signal conditioning modules, dynamic signal acquisition modules, motion control modules, and even controller area network (CAN) connectivity modules, to create custom solutions with unlimited I/O support. With the NI RT Series FieldPoint, you can build rugged embedded data logging and control systems with a full range of I/O compatibility and functionality. RT Series FieldPoint works with all FieldPoint distributed I/O modules including analog I/O, digital I/O, relay, counter, temperature measurement, strain measurement, pulse generation, and pulse width modulation.

For applications that require advanced timing and synchronization, such as high-speed control applications or testing of industrial communications protocols, LabVIEW offers a solution for incorporating the flexibility of FPGA technology by targeting NI reconfigurable hardware equipped with an FPGA embedded on the board. By creating LabVIEW programs and downloading them onto the FPGA chip, you can customize the behavior of the board, providing capabilities such as control over synchronization and timing of all signals and operations, user-definable onboard decision-making logic, and configuring of individual digital lines for input, output, counters and timers, pulse-width modulation, or user-defined protocols.

Deployment Platforms for LabVIEW

When creating programs and applications ranging from monitoring and control to real-time simulation of physical systems, personal computers do not always provide the optimal platform. There is an increasing need to target different devices and embed applications, depending on whether you need faster execution, determinism, or portability. Such needs usually imply learning a new set of instructions and functions and perhaps an entirely different development environment. Typically vendors provide the appropriate set of tools to program a device, as is the case with Microsoft Pocket PC or Palm OS-based PDAs, systems based on real-time operating systems, or VHDL for FPGAs (field-programmable gate arrays). LabVIEW offers an integrated alternative, where you can target many different devices without the need to learn a new development environment. For example, you simply create your application in LabVIEW and download it to a PDA for applications such as handheld signal monitoring or portable data acquisition.

For applications that require real-time data acquisition and control, specifically applications requiring deterministic, real-time control loops, you can download a LabVIEW application onto real-time operating systems running on embedded controllers with a variety of PXI plug-in modules. You can combine these with signal conditioning modules, dynamic signal acquisition modules, motion control modules, and even controller area network (CAN) connectivity modules, to create custom solutions with unlimited I/O. With NI RT Series FieldPoint and Compact FieldPoint controllers, you can build rugged embedded data logging and control systems with a full range of I/O compatibility and functionality. Real-Time FieldPoint and Compact FieldPoint systems can use the complete offering of NI I/O modules, including analog I/O, digital I/O, relay, counter, temperature measurement, strain measurement, pulse generation, and pulse width modulation.

For applications that require advanced timing and synchronization, such as high-speed control applications or testing of custom industrial communications protocols, LabVIEW offers a solution for incorporating the flexibility of FPGA technology embedded on NI reconfigurable I/O hardware. By creating LabVIEW programs and downloading them onto the FPGA chip, you can customize the behavior of the board, providing capabilities such as tight synchronization and timing of all signals and operations, user-definable onboard decision-making logic, and configuring individual digital lines for input, output, counters and timers, pulse-width modulation, or user-defined protocols.

You can also create embedded machine vision applications and deploy them on an NI CVS-145x Compact Vision System, a rugged machine vision package that withstands the harsh environments common in robotics, automated test, and industrial inspection systems. You can also integrate a CVS-145x with the industrial measurement and control capabilities of NI Compact FieldPoint. To program a CVS-145x, you have the choice of configuring your machine vision application quickly with Vision Builder for Automated Inspection, or programming your application with LabVIEW and the Vision Development Module.

For communication between multiple devices, LabVIEW offers built-in functions for using wireless communications capabilities such as 802.11 and Bluetooth.

Back to Top

4. LabVIEW Is Designed for Scientists and Engineers


Whatever tools you rely on, and whether you prefer the interactive configuration-based approach or the flexible, fully-customizable programmatic approach, your ultimate goal is to take measurements. LabVIEW includes tools that are designed specifically to simplify measurement tasks, regardless of whether the source is a data acquisition board or a stand-alone traditional
instrument such as an oscilloscope or a multimeter.

LabVIEW offers high-level data acquisition functions that you can incorporate into your applications. When configuring data acquisition functions, you can use DAQ Assistant, a fully interactive approach to function configuration. When placing the DAQ Assistant Express VI on the block diagram, a wizard-like interface enables you to select the type of measurement you wish to make, the specific channel to use for the acquisition, and the nature of the acquisition (e.g. continuous, one-shot, triggered). Once configured, LabVIEW incorporates all the acquisition settings into the VI and makes all necessary outputs available so that you can now integrate this function with the rest of your application.


Figure 13. LabVIEW DAQ Assistant for interactively creating data acquisition tasks


Figure 14. LabVIEW DAQ Assistant Data Acquisition Task Configuration


You frequently might have to control stand-alone instruments such as oscilloscopes, signal generators, and digital multimeters that communicate through GPIB or serial buses. The task of parsing the resulting ASCII strings and extracting data can quickly become tedious and often accounts for a large amount of the code. LabVIEW provides a network of more than 3,000 instrument drivers from more than 150 vendors, which significantly reduces the amount of time that engineers must invest to get results. In addition, the LabVIEW Instrument I/O Assistant provides a quick and easy way to communicate with instruments. With interactive dialogs, autoparsing, and point-and-click selection of data elements, this assistant makes instrument communication easy and intuitive.


Figure 15. The LabVIEW I/O Assistant automatically parses ASCII string and assigns named outputs

To obtain results from the data collected, you need measurement analysis functions. LabVIEW provides all necessary tools to extract valuable information required for efficient decision making. LabVIEW provides more than 400 measurement analysis, signal processing, and mathematical functions to make sense out of data. These functions rely on efficient industry-standard LAPACK/BLAS algorithms that maximize processing power. These are the same underlying algorithms used in common math packages such as Wolfram’s Mathematica or The MathWorks, Inc. MATLAB®.

Many of these functions are encapsulated in Express VIs, which encompass the most commonly used analysis functions, while making them easy to configure through interactive dialogs.


Figure 16. Spectral Measurements Express VI: Interactive configuration dialog



Figure 17. Express VIs greatly simplify application development


Effective visualization and presentation of results is essential for making decisions, monitoring processes, verifying the condition of an application, and sharing information and results. LabVIEW provides many objects such as charts, 3D graphs, tables, and indicators, which you can drag and drop onto a front panel to show the results obtained. You can interactively manipulate these objects while the application runs and customize the way they are presented. Using the remote panel feature in LabVIEW, you can remotely control your LabVIEW application over the Web without the need for additional programming. LabVIEW automatically embeds your front panel in a standard Web browser. You can then specify designated users who can control your applications remotely from a standard Web browser without installing LabVIEW.

You can also interactively define where to store the results in a variety of formats, such as text or binary. LabVIEW even includes functions to interact with database files such as SQL/ODBC-enabled commercial databases. You can choose to programmatically communicate with industry-standard software (such as Microsoft Excel), define a layout, and transfer data for report generation. LabVIEW also includes connectivity VIs to communicate with and transfer data to interactive report generation and technical data management tools such as National Instruments DIAdem.

Back to Top

5. Conclusion


The net result of all these tools and capabilities in LabVIEW is that you spend less time learning the tools, and more time meeting the demands of your job. In addition, you won’t sacrifice the power required for building high-performance test, measurement, automation, and control systems.

LabVIEW offers interactive configuration-based development that reduces the time required to connect to I/O from stand-alone instruments and data acquisition devices. These tools result in a very short learning curve for engineers new to LabVIEW, and increased productivity for experienced users. Finally, these seemingly simple interfaces generate code that provides unprecedented power to target devices such as PDAs and FPGAs, which in the past had been available only to highly trained engineers.

Back to Top

Bookmark & Share

Ratings

Rate this document

Answered Your Question?
Yes No

Submit