Skip to main content

What is LabVIEW

The LabVIEW Programming Language

LabVIEW is the flagship software product of National Instruments (NI), setting itself apart from conventional programming languages through its unique graphical programming interface.

Traditional programming languages like C, Java, and Python are text-based, each having its own specific application domains and features. They share a fundamental trait: they use keywords and variables to represent data, and statements or expressions to perform computations and operations. Although these languages mirror the structure of natural human languages, they are concise, rigid, and precise, and their lexical and syntactical concepts bear a strong resemblance to natural language systems.

Text-based languages are highly abstract. Their strength lies in conciseness, enabling the expression of complex ideas in a compact form. However, they have a major drawback: being less intuitive, they are more challenging to learn. Mastering a text-based language requires significant time to memorize keywords, data representation methods, and syntax. Memorizing and understanding keywords and functions—which are English-word based—is especially challenging for non-native speakers. Understanding a small code segment in isolation is often difficult; you usually need to read the surrounding code to grasp the underlying logic. For instance, tracing where a variable is defined and how it is subsequently used is not always intuitive in text-based languages. Fully understanding the data flow and logic often requires scanning the entire program.

When interacting with computers, users generally prefer graphical user interfaces. Early DOS-based applications, which featured text-based user interfaces, required users to enter commands or data in response to text prompts. In contrast, later Windows-based applications adopted graphical user interfaces (GUIs), facilitating interaction through mouse-driven actions like dragging and clicking. The stark difference in the popularity of these two approaches reflects a clear human preference: graphical interfaces dominate contemporary computing.

Many modern programming languages have incorporated visual design tools, often referred to as WYSIWYG (What You See Is What You Get) editors, for user interface design. This spares programmers from writing interface code by hand, allowing them to use a mouse to drag, drop, and arrange interface elements and see the results in real time. However, these are not true graphical programming languages; despite the visual tools used to design the UI, their core logic still relies on text-based code.

LabVIEW revolutionizes this by using graphical methods not just for UI design, but also for writing program logic. Opening a LabVIEW program reveals a canvas of small graphical blocks interconnected by colorful wires, replacing traditional text code. This graphical approach to programming is intuitive and accessible, making LabVIEW particularly suitable for beginners. A novice with no prior coding experience can often build simple, functional programs in LabVIEW within days—a learning curve unmatched by most text-based languages.

Development in LabVIEW is also highly efficient. It offers an extensive array of toolkits tailored for measurement, control, and simulation. These toolkits provide much of the boilerplate functionality developers need. As a result, a few graphical blocks and connections in LabVIEW can replace dozens or even hundreds of lines of text-based code, highlighting the power of its graphical approach.

The Graphical Programming Language

G, short for Graphical Programming Language, is the language behind LabVIEW. While LabVIEW is a development environment, its code is written in G (similar to how C is written in Visual Studio), and the two terms are often used interchangeably.

A common misconception is that LabVIEW is merely a specialized application for industrial measurement and control rather than a full-fledged programming language. This misunderstanding stems from two main factors. First, because LabVIEW's visual style is so different from conventional code, people often mistake it for drawing or design tools (like those used for schematic capture or industrial bus configuration). Second, since LabVIEW is predominantly used in measurement and control fields, mainstream software developers are rarely exposed to it.

When working with LabVIEW, it is crucial to adopt a disciplined programming mindset. Software development in LabVIEW mirrors the lifecycle of any other language, encompassing requirements gathering, architecture design, coding, testing, release, and maintenance. While prior coding experience is beneficial, learning LabVIEW requires understanding the unique differences between graphical and textual paradigms. Some patterns and strategies from text-based programming do not translate directly to LabVIEW. This book aims to clarify these differences, helping experienced programmers adapt their skills to the visual workflow.

For beginners using LabVIEW as their gateway to programming, this comparative perspective will also serve as a valuable guide and reference point if they choose to learn text-based languages in the future.

The Versatile Applications of LabVIEW

LabVIEW offers distinct advantages that make it the preferred choice for software development in several specialized fields:

  • Test and Measurement: Originally designed for instrument control, LabVIEW is the industry standard for test and measurement. Over the decades, it has built an unmatched hardware ecosystem. Most mainstream instruments and data acquisition (DAQ) devices come with ready-to-use LabVIEW drivers, making hardware integration seamless. Additionally, a wide array of specialized analysis and measurement toolkits simplifies software development; often, a few high-level functions are all that is needed to build a complete application.

  • Control Systems: LabVIEW's evolution from testing to control was a natural progression. Modules like the LabVIEW Datalogging and Supervisory Control (DSC) module provide built-in tools for industrial monitoring. Ready availability of drivers for PLCs, industrial protocols, and communication buses makes programming and tuning control systems straightforward.

  • Simulation and Prototyping: With its rich library of mathematical and signal-processing functions, LabVIEW is highly suited for simulation and rapid prototyping. Engineers can build virtual prototypes to validate design concepts and catch issues before hardware is manufactured. In academia, LabVIEW is often used to run simulated experiments, providing students with hands-on lab experiences when physical equipment is unavailable.

  • STEM Education: LabVIEW's visual, block-like nature is highly intuitive for children. The popular LEGO Mindstorms robotics kits (specifically the NXT and EV3 generations) used a programming environment powered by LabVIEW. With minimal guidance, students can build and program robots, learning logical thinking without getting bogged down by syntax. Specialized editions of the software are widely used in primary and secondary STEM education.

  • Rapid Development: In practice, a proficient LabVIEW developer can often build and deploy a complex application in about one-fifth of the time it would take using a text-based language like C or C++. This makes it an ideal tool for projects with aggressive deadlines.

  • Cross-Platform Portability: LabVIEW code can run on Windows, macOS, and Linux without modification. Beyond desktop OSes, LabVIEW supports real-time operating systems and embedded hardware, compiles directly to FPGAs, and runs on NI Linux Real-Time target systems, offering a unified development experience across desktop and embedded hardware.

The Evolution of LabVIEW

National Instruments (NI) was founded in 1976 with the vision of connecting traditional instruments to personal computers. At the time, the standard interface for instruments was the General Purpose Interface Bus (GPIB). NI's first breakthrough product was a GPIB interface card for PCs, which enabled seamless data transfer and laid the foundation for computer-controlled instrumentation and software-based data analysis.

In 1986, NI introduced Laboratory Virtual Instrument Engineering Workbench, better known as LabVIEW.

  • LabVIEW 1.0: Originally developed for Apple Macintosh computers, which pioneered the graphical user interface. Inspired by the Mac's GUI, NI designed LabVIEW as a fully visual programming environment. Running on Motorola 68000 CPUs, LabVIEW 1.0 was an interpreted language with simple syntax, supporting only a single data type: floating-point numbers.

  • LabVIEW 1.1: This version introduced a crucial optimization technique: buffer reuse (in-place execution). Crucial for LabVIEW's dataflow-driven paradigm, this minimized unnecessary data duplication and boosted execution speed. Optimizing buffer allocation remains a key focus for memory management in LabVIEW today.

  • LabVIEW 2.0: This version introduced a true compiler, shifting from interpreted execution to compiling code directly into Motorola 68000 machine code. This dramatically improved performance. It also introduced compile-time syntax checking and support for parallel execution, a precursor to multithreading, by automatically scheduling code paths that had no sequential dependencies.

  • LabVIEW 2.5: Added support for the x86 architecture, marking the beginning of its cross-platform journey. LabVIEW eventually expanded to PowerPC and other processors. However, maintaining multi-platform portability brought unique traits. For example, the LabVIEW IDE featured a custom, platform-independent look (characterized by its dark gray panels and 3D buttons) rather than native Windows styling. Additionally, LabVIEW chose big-endian format for integer storage (matching the Motorola processor format), which remained its standard even on little-endian x86 PCs, introducing a subtle nuance when interacting with binary files or external systems.

  • LabVIEW 3: Introduced key concepts like property nodes and local variables. By this time, developers were using the platform to build large-scale applications containing thousands of subVIs.

  • LabVIEW 4: This was the first version I ever used, arriving on a stack of a dozen 3.5-inch floppy disks. Even with its older aesthetic, LabVIEW amazed me with its ease of use. Creating a user interface was as simple as dragging a switch control from a palette—something that would have taken hours to write by hand in C at the time. While the visual wire-connection paradigm took some getting used to for someone with a text-based programming background, it offered a refreshingly fast way to build software.

  • LabVIEW 5: Introduced code generation technology that allowed the compiler to compile for different hardware architectures, laying the groundwork for targeting real-time (RT) systems. Crucially, LabVIEW 5.0 also introduced native multithreading support, significantly boosting its capabilities and performance.

  • LabVIEW 6: Redesigned the user interface with modern 3D controls. This version also added native event-driven programming (the Event Structure) and improved network programming support, enabling the creation of much more responsive and connected applications.

  • LabVIEW 7: Introduced Express VIs (configuration-based nodes) to speed up common tasks. It also introduced LabVIEW FPGA and LabVIEW DSP, allowing graphical code to compile directly onto silicon chips and embedded processors.

  • LabVIEW 8: Brought major compiler upgrades, shifting from static to dynamic register allocation for better CPU optimization. It also introduced dead code elimination and other advanced optimizations. For managing larger codebases, LabVIEW 8 introduced Project Libraries (.lvlib), the LabVIEW Project Explorer (.lvproj), and native Object-Oriented Programming (OOP).

  • LabVIEW 2009: Released a 64-bit compiler to support modern computing requirements. It also introduced a structured compiler backend utilizing Dataflow Intermediate Representation (DFIR). Operating between the block diagram and machine code generation, DFIR enabled high-level optimizations like constant folding, dead code elimination, and loop-invariant code motion.

  • LabVIEW 2010: Integrated the LLVM compiler infrastructure as its backend, bridging the gap between DFIR and raw machine code. This brought state-of-the-art optimizations like instruction scheduling, loop unrolling, register allocation, and subVI inlining, greatly increasing code execution speeds.

  • From 2011 Onward: NI focused heavily on developing a next-generation platform, LabVIEW NXG. While this meant the classic LabVIEW runtime saw fewer structural overhauls, the G language itself continued to mature. Critical software engineering features were added to classic LabVIEW, including Channel Wires for asynchronous communication (2016), Malleable VIs (.vim) for generic programming (2017), native Map and Set collections (2019), and Interfaces for OOP (2020). Ultimately, LabVIEW NXG was discontinued in 2020, and NI refocused resources entirely on classic LabVIEW.

  • In 2020: NI released the free LabVIEW Community Edition for non-commercial use, lowering the barrier to entry for hobbyists and students. This release also allowed me to resume writing and updating this book after a 10-year hiatus when I lacked access to the software.

  • In 2023: NI was acquired by Emerson, marking a new chapter for the LabVIEW platform and its role in industrial automation and engineering.