Customize and Repeat Measurements With LabVIEW and LabVIEW NXG

Publish Date: Jun 09, 2017 | 0 Ratings | 0.00 out of 5 | Print

Overview

Use LabVIEW or LabVIEW NXG to customize and automate your measurements with a graphical programming approach that reduces the complexity of traditional programming. With this graphical approach, you can focus on your engineering problem by mapping your thoughts to functional code. Use the built-in, drag-and-drop engineering objects to create user interfaces to visualize your measurements.

Table of Contents

  1. Automating Measurements Using Graphical Programming
  2. Building a VI to Acquire Measurements
  3. Starting Points to Begin Automating Your Measurement
  4. Additional Resources

1. Automating Measurements Using Graphical Programming

Use the graphical programming approach in LabVIEW to customize and automate how you acquire your measurements. With graphical programming, you create code by wiring together graphical icons on a diagram, which in the background is compiled into the necessary machine code for your computer to execute. In LabVIEW, the graphical icons on a diagram represent common constructs, such as loops, variables, and data types, used in all programming languages.

 

Figure 1: A While Loop in LabVIEW is represented as a loop that executes until a stop condition is met. You can use a While Loop to repeatedly acquire measurement data. 

 

Graphical programming in LabVIEW differs from traditional text-based languages because code developed in LabVIEW executes according to the data flow model rather than the traditional sequential approach. In the data flow model, a function executes only when it receives all required inputs. When a function executes, it produces output data and passes the data to the next function in the path. The movement of data through the functions determines the execution order of the program.

 

Figure 2: An example of data flow programming. The Subtract function executes only when both inputs are available. 

 

Engineers and scientists are often characterized as “visual thinkers” and heavily rely on flowcharts and models. Using a graphical programming approach, you can map how you view your system into code without learning syntax associated with a text-based language.

Back to Top

2. Building a VI to Acquire Measurements

The building block of all LabVIEW applications is a VI. The VI is a LabVIEW program that has two components: a front panel and block diagram. 

Front Panel 

The front panel is the user interface for your VI. Using the built-in, drag-and-drop engineering objects, you can create a user interface to visualize data and to interact with your LabVIEW code.

Figure 3: The front panel of a VI allows you to interact with LabVIEW code. 

 

You can create a custom user interface with engineering-specific front panel controls and indicators. Controls are typically knobs, push buttons, dials, and sliders that a user can manipulate to pass data to the code of VI in the block diagram. Indicators are typically graphs, charts, and LEDs that display signals and additional information to the user. Select the control or indicator to fit your needs from the Controls palette on the front panel.

 

Figure 4: Controls Palette 

 

Block Diagram

The block diagram contains the code of the VI and includes terminals, subVIs, functions, structures, and wires that execute custom logic or configure repeatable measurements.

 

Figure 5: Every control and indicator on the front panel has a corresponding block diagram terminal. 

 

Nodes are objects on the block diagram that have inputs and/or outputs and perform operations when a VI runs. The common nodes on the block diagram are:

  • Functions—Fundamental operating elements such as add and subtract
  • SubVIs—VIs that are built into LabVIEW or are user-defined and called in another VI
  • Structures—Elements that control the execution of code

Figure 6: Functions Palette 

Back to Top

3. Starting Points to Begin Automating Your Measurement

LabVIEW provides several starting points in the development environment so you don’t have to start programming your measurement application from scratch. You can use example code shipped with LabVIEW to build from and customize to fit your project requirements. Discover examples in LabVIEW to help with implementing automated data acquisition or applying advanced analysis by navigating to Help>>Examples.

 

Figure 7: You can modify a LabVIEW example to fit the needs of your application. 

 

 

Back to Top

4. Additional Resources

Back to Top

Bookmark & Share


Ratings

Rate this document

Answered Your Question?
Yes No

Submit