LabVIEW stands for Laboratory Virtual Instrument Engineering Workbench. It is a graphical programming language called ‘G’. Developers use LabVIEW to create programs for automated test and measurement systems, including those for product testing and related applications.
A block diagram is the essential framework for any virtual instrument (VI) in LabVIEW. In this tutorial, we’ll learn how to build block diagrams in LabVIEW and use LabVIEW tools to connect to VIs representing test or measurement instruments effectively.
This article deals with virtual instruments and modular programming in detail.
Table of Contents:
In this part of the tutorial, we’ll discuss block diagrams in LabVIEW in detail and their components. We will also learn how to open, edit, save, and place subVIs.
A LabVIEW block diagram is a graphical representation of the source code for a LabVIEW program. That’s where you define the program logic for acquiring data, controlling devices, and more. In LabVIEW, you will create VIs similar to programs used in text-based programming languages.
LabVIEW block diagrams consist of visual components representing I/O operations, functions, and data flow. They allow you to separate program logic from the user interface. The front panel serves as the interface for input and output.
The LabVIEW block diagram lets you see how data flows between various LabVIEW components.
Front-panel objects appear as terminals in the block diagram. Terminals on the block diagram show the changes made to the front panel objects.
Block diagram objects include terminals, subVIs, functions, constants, structures, and wires that transfer data among other block diagram objects.
You can use LabVIEW tools to create, modify, and debug a VI. A tool is a special operating mode of the mouse cursor, so the operating mode of the cursor corresponds to the icon of the selected tool.
LabVIEW selects the tool based on the mouse's current location. You can manually select the tool you need from the Tools palette. Now you can choose your desired tool, which remains selected until you choose another tool from the Tools palette.
You can use the buttons on the VI toolbar to:
| If you want to enrich your career and become a professional in LabVIEW, then enrol in "LabVIEW Online Training". This course will help you to achieve excellence in this domain. |
A LabVIEW block diagram can be built using components like functions, controls, wires, and indicators. These components are the building blocks of LabVIEW Virtual Instruments.
Let’s take a deep look at the components in this section.
1) Functions
Functions are the core of any LabVIEW block diagram, and their icons have a pale yellow background. These include mathematical operations, signal processing, and data analysis.
In LabVIEW, functions are grouped into many categories, as outlined below.
Image
2) Wires
In LabVIEW, you use wires to connect controls, indicators, and functions. Wires in a block diagram represent data flow between components, allowing you to monitor and troubleshoot them when needed.
Depending on their data types, you can find wires in different styles, colors, and thicknesses as follows:
Image
3) Wire Features
4) Terminals
5) Controls
Image
6) Indicators
Image
7) Structures
Structures in LabVIEW support organizing programs, processing functions, and controlling the flow of program execution.
Below are the typical structures used in LabVIEW block diagrams.
8) SubVIs
Image
9) Nodes
10) Express VIs
11) Error handling
LabVIEW includes error-handling functions for issues such as invalid inputs and hardware failures. These functions enable actions based on needs, such as halting the program or logging the error.
Here is a list of the benefits of LabVIEW block diagrams.
Related article: Local and Global Variables in LabVIEW
Front panel objects also have property dialog boxes that you can use to change the look or behavior of front panel objects. You can right-click the front panel object. Then, you must select ‘Properties’ from the shortcut menu to access the property dialog box for an object.
The options available on the property dialog box for an object are similar to those of the shortcut menu for that object.
You can create, change, and debug VIs using the tools located on the floating Tools palette. A tool is a special operating mode of the mouse cursor. The cursor corresponds to the icon of the tool selected in the Tools palette.
You can use the tools to operate on and modify front-panel and block-diagram objects. You can manually select the tool you need from the Tools palette.
Consider a scenario in which you must create a block diagram to add two numbers.
Solution:
Here is the step-by-step procedure to create a VI that adds two numbers.
A. Design the front panel
Image
B) Create the block diagram
Image
C) Run and Test the VI
Image
In this example, the input data flows from numeric controls to the add function, which processes it. Then, the output data flows from the add function to the numeric indicator.
Related article: LabVIEW Programming
The connector pane is a group of terminals related to the controls and indicators of that VI. It is similar to the parameter list of a function call in text-based programming languages.
Let’s dig further into the connector pane in LabVIEW.
Assigning Terminals to Controls and Indicators:
After you choose a pattern to use for the connector pane, you must assign a front panel control or indicator to each of the connector pane terminals. To link controls and indicators to the connector pane, place inputs on the left and outputs on the right to avoid complex or confusing wiring.
You need to complete the following steps to assign terminals to controls and indicators in a connector pane.
Image
Confirming Terminal Connections:
To confirm which control or indicator is assigned to a connector pane terminal, click the terminal in the connector pane. A marquee highlights the assigned object.
You can also use the wiring tool to click the control or indicator. The color of the assigned terminal in the connector pane darkens.
Deleting Terminal Connections:
You can delete connections between terminals and the corresponding controls or indicators individually or all at once. Follow these steps to delete a terminal connection.
When you double-click a subVI, a front panel and a block diagram appear, instead of a dialog box to configure options. The subVI controls and indicators receive data from and return data to the block diagram of the calling VI.
You need to click the ‘Select a VI’ icon or text on the Functions palette, navigate to, and double-click a VI. Then, you can place the VI on a block diagram to call a created subVI.
Complete the following steps to open and edit a subVI.
Placing SubVIs On Block Diagrams:
Complete the following steps to place a subVI on the block diagram.
Saving SUBVIs:
Select File → Save to save a VI. You can save VIs as individual files or group several VIs into a LabVIEW Library (LLB). LLB files end with the extension .llb. National Instruments recommends saving VIs as individual files, organized in directories.
Modularity is the use of smaller elements to accomplish a larger goal. Program modularity in LabVIEW refers to dividing code into smaller units called subVIs.
Let’s learn how to construct a subVI, customize its icon appearance, and build and configure the connection pane.
You can convert a section of a VI into a subVI by using the positioning tool to select the section of the block diagram you want to reuse. Then select Edit → Create SubVI from the menu to change the selected portion into a subVI. The SubVI is created with a default icon.
Image
An icon for the new subVI replaces the selected section of the block diagram. LabVIEW builds controls and indicators for the new subVI. It automatically configures the connector pane based on the number of control and indicator terminals you selected, and wires the subVI to the existing wires.
You can select Edit → Create SubVI to create a subVI.
Image
Creating a subVI from a selection is convenient, but it still requires careful planning to build a logical hierarchy of VIs.
Let’s discuss the debugging and error handling practices you adopt to optimize subVIs in a block diagram in LabVIEW.
LabVIEW VIs can communicate with hardware devices using APIs, libraries, and drivers. These tools support connecting LabVIEW with hardware used in instrument control, data acquisition, and many other applications.
Let’s take a look at the interfacing tools in this section.
Yes, beginners can learn LabVIEW easily. If they have a basic understanding of testing systems, instrumentation, controls, and indicators, it will help them learn LabVIEW more quickly.
You can learn LabVIEW in four weeks. If you continue practicing hands-on exercises beyond the training, you will gain mastery of the LabVIEW programming language and develop testing systems.
It’s a wrap! You have understood that you can create block diagrams for various applications, from simple mathematical calculations to complex data-acquisition and control systems, using LabVIEW.
If you want to learn LabVIEW in-depth and work on real-time examples, you can reach out to MindMajix. By the end of the training, you will acquire the in-demand skills required for a competent LabVIEW professional and be ready to apply for multiple job roles.

Our work-support plans provide precise options as per your project tasks. Whether you are a newbie or an experienced professional seeking assistance in completing project tasks, we are here with the following plans to meet your custom needs:
| Name | Dates | |
|---|---|---|
| LabVIEW Training | Jul 18 to Aug 02 | View Details |
| LabVIEW Training | Jul 21 to Aug 05 | View Details |
| LabVIEW Training | Jul 25 to Aug 09 | View Details |
| LabVIEW Training | Jul 28 to Aug 12 | View Details |

Priyanka Vatsa is a Senior Content writer with more than five years’ worth of experience in writing for Mindmajix on various IT platforms such as Palo Alto Networks, Microsoft Dynamics 365, Siebel, CCNA, Git, and Nodejs. She was involved in projects on these technologies in the past, and now, she regularly produces content on them. Reach out to her via LinkedIn and Twitter.