Training Data Visualization LabVIEW — Graphical Data Acquisition & Display
8 / 10

LabVIEW — Graphical Data Acquisition & Display

24 min Data Visualization

LabVIEW — Graphical Data Acquisition & Display

What Is LabVIEW?

LabVIEW (Laboratory Virtual Instrument Engineering Workbench) is a graphical programming platform developed by National Instruments (NI). Instead of writing text-based code, you wire together functional blocks on a block diagram. LabVIEW excels at data acquisition (DAQ), instrument control, and real-time measurement.

Core Terminology
  • VI (Virtual Instrument) — a LabVIEW program. Every VI has two views: the Front Panel (UI) and the Block Diagram (logic).
  • Front Panel — the user interface: controls (inputs) and indicators (outputs).
  • Block Diagram — the wiring diagram where you connect function nodes with colored wires.
  • Control — an input element (knob, slider, numeric entry). Appears as a terminal on the block diagram.
  • Indicator — an output display (graph, gauge, LED). Reads data from the diagram.
  • Data wire — carries data between nodes. Wire color indicates type: orange = double, blue = integer, green = boolean, pink = string.
  • SubVI — a reusable VI called inside another VI (like a function call).
Data Types in LabVIEW
TypeWire ColorDescription
Double (DBL)Orange64-bit floating-point — most common numeric type
Integer (I32)Blue32-bit signed integer
BooleanGreenTRUE / FALSE
StringPinkText data
ArrayThicker wireOrdered collection of same-type elements
ClusterBrown / pinkBundle of mixed types (like a struct)
WaveformBrownContains $t_0$, $\Delta t$, and data array — used for time-domain signals
Visualization Elements
  • Waveform Chart — scrolling real-time display. Appends new data points as they arrive.
  • Waveform Graph — displays an entire array at once (static plot). Variables: x-axis (time or index), y-axis (amplitude).
  • XY Graph — scatter/arbitrary plots. Takes an (X array, Y array) cluster.
  • Intensity Graph — heat map visualization. A 2-D array maps to pixel colors.
  • Digital Waveform Graph — displays binary/digital signals.
Dataflow Programming

LabVIEW uses dataflow execution: a node executes only when all its input wires have data. This is fundamentally different from text-based sequential execution. Multiple independent branches execute in parallel automatically.

Loops and Structures
  • While Loop — repeats until a stop condition. Iteration terminal i counts from 0. Contains a conditional terminal (stop button).
  • For Loop — repeats $N$ times. Wire $N$ to the count terminal. i goes from 0 to $N-1$.
  • Case Structure — equivalent to if/else or switch. A selector terminal picks the case to execute.
  • Shift Register — passes data from one loop iteration to the next (like a variable that persists across iterations).
Example 1 — Acquire and Plot

Read a voltage signal from a DAQ device and display it on a waveform chart.

Block Diagram:

1. Place a DAQ Assistant inside a While Loop.

2. Wire the DAQ output (waveform) to a Waveform Chart indicator.

3. Wire a Stop button to the loop's conditional terminal.

Variables: DAQ output — waveform containing voltage samples, $\Delta t$, and start time; Chart — scrolling display that appends each iteration's data.

Example 2 — Compute RMS Voltage

Given an array of voltage samples, compute the RMS value.

RMS formula: $V_{\text{rms}} = \sqrt{\frac{1}{N}\sum_{i=1}^{N} v_i^2}$

Block Diagram: Wire array → Square (element-wise) → MeanSquare RootIndicator.

Variables: N — number of samples; $v_i$ — individual voltage readings; $V_{\text{rms}}$ — root mean square result.

Example 3 — XY Parameter Plot

Plot a Lissajous figure: $x = \sin(3t)$, $y = \sin(2t)$, $0 \le t \le 2\pi$.

1. Create array t = 0 to $2\pi$ (use Ramp Pattern or For Loop).

2. Wire t into two Sine functions with frequencies 3 and 2.

3. Bundle the X and Y arrays into a cluster → wire to XY Graph.

Variables: t — parameter array; x, y — computed sine arrays; XY Graph — displays the parametric curve.

Practice Problems

1. What does VI stand for?
2. What are the two views of every VI?
3. What is the difference between a control and an indicator?
4. What color wire carries a floating-point number?
5. What is dataflow execution?
6. Waveform Chart vs. Waveform Graph — which scrolls in real time?
7. What structure repeats N times?
8. What does a shift register do?
9. How do you display a Lissajous figure?
10. What is a SubVI?
11. Name two types of graphs available in LabVIEW.
12. What company develops LabVIEW?
Show Answer Key

1. Virtual Instrument

2. Front Panel (UI) and Block Diagram (logic/wiring)

3. Control = input (user can set); Indicator = output (program displays)

4. Orange

5. A node executes only when all its inputs are available — not line-by-line

6. Waveform Chart (appends data in real time)

7. For Loop

8. Passes the value of a variable from one iteration to the next

9. Use an XY Graph with parametric sine arrays bundled into a cluster

10. A reusable VI placed inside another VI — like a function call

11. Waveform Graph, XY Graph, Intensity Graph, Waveform Chart (any two)

12. National Instruments (NI)