Customize and Repeat Measurements With LabVIEW NXG


LabVIEW NXG helps you customize and automate your measurements with a graphical programming approach that simplifies traditional programming. With this graphical approach, you 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.

Evaluate LabVIEW NXG to Measure Physical Systems with Sensors or Actuators

Evaluate LabVIEW NXG to Develop Production Test Systems


Automating Measurements Using Graphical Programming

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


Figure 1: A While Loop in LabVIEW NXG 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 differs from traditional text-based languages because code developed in LabVIEW NXG 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.

Building a VI to Acquire Measurements

The building block of all LabVIEW NXG applications is a Virtual Instrument (VI). The VI is a LabVIEW NXG program that has two components: the panel and diagram. 


The 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 interact with your LabVIEW NXG code.

Figure 3: You can interact with LabVIEW NXG code on the panel of a VI.  


You can create a custom user interface with engineering-specific 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 on the 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 panel.


Figure 4: Controls Palette 



The 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 panel has a corresponding diagram terminal. 


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

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

Figure 6: Functions Palette 

Starting Points to Begin Automating Your Measurement

LabVIEW NXG 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 NXG to build from and customize to fit your project requirements. Discover examples in LabVIEW NXG to help with implementing automated data acquisition or applying advanced analysis by navigating to Help»Examples.


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