LabVIEW
LabVIEW (Laboratory Virtual Instrument Engineering Workbench) is National Instruments' graphical language, first released in 1986 for the Macintosh. A program is a block diagram of nodes connected by wires. A node runs as soon as all its inputs have data, which is dataflow in its most visible form.
Paradigm: Reactive and Dataflow Programming
What Makes LabVIEW Special
- Wires carry data. The order of execution is set by the wires, not by the order of statements. A node runs when every input wire has a value.
- Automatic parallelism. Two independent branches of the diagram run at the same time, with no thread code. Loops and structures also run in parallel when their data allows.
- Front panel and block diagram. Each program (a VI, virtual instrument) has a front panel with controls and indicators (the user interface) and a diagram with the logic.
- Built for hardware. Drivers for data acquisition, oscilloscopes, cameras and PLCs turn a measurement into a node, so an experiment can be built in hours.
- Structures instead of statements. A While Loop, For Loop, Case Structure or Event Structure is a box you draw around part of the diagram. Shift registers carry values from one iteration to the next.
Example: A tiny dataflow diagram
[ Numeric A ]-----\
[ Add ]-----[ Multiply ]-----[ Indicator: Result ]
[ Numeric B ]-----/ |
[ Constant 10 ]
Text equivalent: result = (A + B) * 10
How It Works
- The two controls A and B are sources. Add cannot run until both have delivered a value, and this rule replaces sequencing.
- Multiply waits for the Add output and the constant 10, and its result flows into the Indicator on the front panel.
- If the diagram also had an independent branch, such as a timer, LabVIEW would run it concurrently with this one automatically.
- Because LabVIEW is graphical, this example is drawn in ASCII. In the environment you would drag nodes onto the diagram and connect them with the mouse.
History and Where It Is Used
LabVIEW is standard in laboratories, manufacturing test, semiconductor and aerospace validation, and automation. Similar dataflow environments include Simulink, Node-RED, Max/MSP, Blender shader nodes and Unreal Blueprints. Text languages offer the same idea in libraries such as RxJS.
Learn More
- LabVIEW (Wikipedia)
- NI LabVIEW
- Back to Reactive and Dataflow Programming or the PGP roadmap.