LabVIEW — Graphical Data Acquisition & Display
LabVIEW — Graphical Data Acquisition & Display
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.
- 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).
| Type | Wire Color | Description |
|---|---|---|
| Double (DBL) | Orange | 64-bit floating-point — most common numeric type |
| Integer (I32) | Blue | 32-bit signed integer |
| Boolean | Green | TRUE / FALSE |
| String | Pink | Text data |
| Array | Thicker wire | Ordered collection of same-type elements |
| Cluster | Brown / pink | Bundle of mixed types (like a struct) |
| Waveform | Brown | Contains $t_0$, $\Delta t$, and data array — used for time-domain signals |
- 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.
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.
- While Loop — repeats until a stop condition. Iteration terminal
icounts from 0. Contains a conditional terminal (stop button). - For Loop — repeats $N$ times. Wire $N$ to the count terminal.
igoes 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).
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.
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) → Mean → Square Root → Indicator.
Variables: N — number of samples; $v_i$ — individual voltage readings; $V_{\text{rms}}$ — root mean square result.
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
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)