LabVIEW Tutorial

We always think about the easiest graphical programming, when we decide to work on graphical applications projects. In recent days there is one of the popular graphical programming applications available that is LabVIEW. This LabVIEW tutorial will explain the usage of many inbuilt supporting features and provides communications with many hardware development applications. I will explain in detail about LabVIEW tutorial in the below pages.

What is LabVIEW?

LabVIEW is one of the software development systems first introduced by National Instrument Inc. This software development system used in many applications such as industrial applications, experiment applications, educational measurement applications, and automation applications. LabVIEW is available in the form of a graphical programming type, which supports many textual programming languages like C, MATLAB programming, and Math script. LabVIEW system has a large number of functional features for data visualizations, designing, and numerical analysis applications. Many areas like mathematics, controlling, signal processing system, system and data identifications, and simulation applications designed based on the LabVIEW system. It also supports third-party communications with hardware systems like OPC, GPIB, and Modbus, etc.

The LabVIEW Environment:

In this section, we will discuss the LabVIEW Environment,

LabVIEW Environment is an ecosystem where the LabVIEW software development system exists. This environment consists of different elements that are used for program development within the LabVIEW system. This Environment also comprises many tools that help to develop LabVIEW applications.

Now let me explain about LabVIEW Environment tools,

Templates and project samples:

This is one of the important tools available in the LabVIEW environment, it consists of many common templates used for starting projects with already existing projects which give information like how the project may work and need any customizations for all type of business applications.

Finding example tool:

This component consists of many code snippets that can help you to develop many methodologies that describe the project. Example finder tools can be used or customized as per your project requirement.

Debugging tools:

The debugging tool is an essential part of any project development. This enables users to speedy the debugging of the program. Elements included are Probes method, breaking points, Single-step method, and high executions.

Source Control:

This Source control tool is mainly used for configuration management purposes. It helps a large number of groups can work together on the development of project applications.

LabVIEW tools network:

LabVIEW network tools enable the users to download the toolkits to perform a specific task. Some of these tools are provided by the mother company of LabVIEW named National Instruments and other its child companies (or you can call them as its partners)

Learn how to use labview, from beginner basics to advanced techniques with online video tutorials taught by industry experts.

Enroll for Free Labview Online Training Demo!

Why LabVIEW?

Let us know the importance of LabVIEW,

  • LabVIEW has wide integration capacity and offers compatibility to work with many data drivers and manufacture platforms like ISO, ANSI, ASTM international and NIST, etc.
  • Its communication with web standards and protocols such as Ajax, Web Services, ActiveX, CGI, and TCP, etc.
  • It’s an intuitive graphical programming language.
  • Its compatibility with Matlab files for complex mathematics-based applications.
  • It is mainly designed for remote control
  • It is a web server tool so that it holds the capability to easier work through online using few steps
  • Supports building a remote application in LabVIEW with limited software development capability only a professional programmer but only a basic LabVIEW course
  • Several companies release many commercial products on which many remote lab applications could be built such as NI, ELVIS, and Festo all are LabVIEW based.

Labview Training

  • Master Your Craft
  • Lifetime LMS & Faculty Access
  • 24/7 online expert support
  • Real-world & Project-Based Learning

LabVIEW Controls and Indicators:

A LabVIEW application is mainly designed on two methods those are Controls and Indicators. Controls work as an Input and also ‘control’ the data while accessing LabVIEW application. Indicators work as an output or 'Indicate' the data, graphics, and information. Let us see how these two methods work,

  • Control in LabVIEW application, mainly allow business users to input data
  • Indicators in LabVIEW application mainly allow business users to get the output and also it displays the output in the form of data, graphics, and information.
  • If you want to change the already existing control or indicator-> just right-click the control or indicator button-> change them to control or change them to indicator.
  • Controls and indicators are placed from the standard controls palette toolbar->Front panel
  • When users place the controls or indicators on the front panel of the LabVIEW then it will create the block diagram is created automatically.
  • Double click on the control or indicator-> it will create the block diagram for that respective controls or indicators
  • Block diagram controls -> at right you have data terminals control and at left you have data terminals on the left side of the panel.

LabVIEW datatypes:

LabVIEW supports many data types such as,

  • Boolean
  • Numeric
  • Array
  • Strings

I will explain all these data types in brief,

Boolean: Booleans available in two values that are ‘True’ or ‘false’-> these two are indicated by green data wires.

Numeric: Numeric in LabVIEW has many sizes and representations. For example,

Integers: Integers can be used to represent signed or unsigned whole numbers -> blue data wire indications

Doubles and singles: These are the signed numbers can be represented by decimal components-> orange data wire indications

Numeric size in LabVIEW is indicated by bits and size of the possible values.

Strings: Strings in LabVIEW are represented with character sequences-> pink wire data indication

Arrays: Arrays are a group of data types-> indicated by thicker data wires

  • Arrays are distinguished into two types -> 1 dimensional and 2-dimensional arrays,
  • One dimensional array can be represented in a column and two-dimensional arrays can be represented in a table.

Clusters: Clusters in LabVIEW are a group of data types -> thick brown data wires

Clusters are available in Error clusters – a special type of cluster used for identifying errors and warnings.

These error clusters are classified into 3 types

  • Boolean status
  • Error code
  • String sources.

Subscribe to our youtube channel to get new updates..!

Dataflow in LabVIEW:

LabVIEW dataflow represents the execution of codes; a block diagram in LabVIEW executes the code once receive the data for all required inputs. Once you execute the code in a block diagram, it returns the data which flow into other block diagrams for further executions. The primary function of this dataflow is to control the program executions.

  • Block diagram typically has input and output terminals, input terminals on the left side of the block diagram, and output terminals on the right side of the block diagram.
  • This dataflow organizes the code that helps to flows the data from left to right.
  • If you have block diagram elements with no data wire and it will force the execution in any order.
  • Error wire in the block diagram is commonly used to prevent any kind of error or warning while execution of dataflow.

Top 30 labview interview questions and answers for 2020

Debugging in LabVIEW:

LabVIEW environment offers many options for debugging LabVIEW codes. Let me explain what all the subsets come under this section are,

Broke Run Arrow: This component indicates that code cannot be executed due to errors.

Steps to know:

  • Click on the broken run arrow-> it will display an error
  • Double click on the errors-> this will highlight the location of the errors in the diagram.

Highlighting execution: this component used to visualize the code execution

  • While working with LabVIEW debugging, users should be very careful because this may lead to the slower execution of the code and also changes in the behavior of bugs' specification time

Breakpoints: This component is used to stop the code execution at specific nodes.

Steps to know:

  • Once you hit the breakpoint -> you can use the single-stepping that enables the->execution of highlight or -> you can unpause the application

Probes: Probes in LabVIEW used to monitor the data wire values without changing any application execution speed.

While loop and for loop in LabVIEW:

While loop in the LabVIEW allows the application to execute repeatedly until some conditions met.

Steps:

  • Go to functions Palette-> select while loop-> click on the structures-> drag this on the block diagram -> draw a box
  • The conditional statement is used to exit the while loop once the specified condition is met.
  • This conditional statement is tested at the end of the loop iteration point. There while loop executes always execute at once.
  • When you pass the true value to the conditional statement will terminate the while loop.
  • The iteration terminal offers the current loop that counts from zero.
  • By default, the while loop condition executes as quickly as possible. Use the wait (MS) or any other control primitive speed units.
  • If you use multiple while loops those will be distributed across multiple CPU cores.

For loops in LabVIEW:

For Loops in LabVIEW used to execute an application repeatedly. They usually iterate over any data set and allow operating any fixed number of times. 

Steps:

  • Select the loop from Functions palette-> then click the structures-> then drag them on the block diagram.
  • Count terminals explain how many times the code will execute in the loop,
  • This count is tested before each loop iteration sets get executed. It may lead the code inside the loop may never execute (suppose if the count is lesser than or equal to 0).
  • The iteration terminal helps the current loop count starting from zero.
  • In LabVIEW, by default, these for loops execute quickly, better to use Wait (MS), or any other primitives to control the execution speed.

Labview Training

Weekday / Weekend Batches

Passing data into and out of LOOP:

Data can be transferred to both the loop structures (While loop and for loop), there are many primitive controllers available to control the data transactions in the LabVIEW loops.

  • A tunnel will be created through the passing data in and out.
  • Input: Each loop iteration in the LabVIEW environment, the same value will be provided at an input tunnel.
  • Output: A loop must execute to completion before passing any data out through a tunnel. Once finishes the last value at an output tunnel will be passed out.
  • Shift Registers: This can be used to pass the data from one loop iterations to the next.
  • to create a Shift register ->just right-click the loop edge -> choose to Add shift Register
  • To change a tunnel to any shift register-> right-click the tunnel-> choose to replace with a shift register.
  • Arrays: when passing Arrays into the loop auto-indexing can be used to iterate over the array.
  • To auto index, any array into the loop -> just right click on the tunnel-> choose to enable indexing.
  • Each loop iteration the next value in the array is passed into the loop.
  • Auto indexing can also be used on the outputs of the loop to create an array of data automatically.

[Related article : Labview tutorial]

Case Structure:

Case Structure in LabVIEW executes the codes based on the conditions of loop value. Let me explain in details,

  • Select a case structure from Functions Palette->click on the structure-> drag it on the block diagram to draw a box.
  • The case structure in LabVIEW contains a subdiagram or case flows.
  • Users can pass the value into the case structure terminal-> which describes the case execution.
  • Case selector in LabVIEW is a Boolean data type by default and you will get output in the form of ‘True’ or ‘False’
  • If the user tries to connect with another data type then automatically Case selector will change into a Boolean data type.
  • The Selector label in the LabVIEW describes the conditions involved in each subdiagram
  • To active this just left-click the Selector label-> change the conditions with each subdiagram
  • If you want to add or remove sub-diagram-> by right click the edge of the case structure or-> select the label.
  • Data value in case structure is passed into or out using tunnels -> this will automatically generate when the data value is wired into or out of the case structure.

Modular Code in LabVIEW:

Modular Code in LabVIEW makes applications easier to develop, debug, and maintain. Let's get into the full detail,

  • A Sub VI is usually a chunk of reusable code.
  • Data values passed into and out of Sub VI across terminals
  • Create a Sub VI terminals-> connect the front panel controls and indicators-> to the connector pane.
  • Sub VI icons help the user to keep the code easy to read and maintain.
  • Use the VI properties->this will add context help to a Sub VI.
  • Click file->VI properties or you can use Ctrl+I-> select documentation.
  • To place a custom Sub VI on the block diagram-> Select Functions palette->select A VI -> select Sub VI or you can also use another way to create Custom Sub VI like click and drag the Sub VI onto the block diagram.
  • Add code comments to the Sub VI ->by double-clicking anywhere on the block diagram.                       

Advantages of LabVIEW programming:

There are lots of advantages available with LabVIEW applications, namely:

  • Easy to use, interactive, and graphical programming language.
  • LabVIEW provides a broad engineering tool.
  • LabVIEW has built-in measurements and analysis functionality that help users to get some hands-on experience.
  • LabVIEW provides open connectivity to leading engineering tools such as multisim, Mathcad, Mathematica, Excel, and more.
  • Widely used application tool.

Insight:

Till now I have tried to explain the basic concepts of LabVIEW. In this article, you will know the features and advantages of the LabVIEW tool. LabVIEW is one of the most widely used graphical applications programming tools. It has many advanced features that support even non-programmer can also learn and adapt to many real-time industry applications. I hope this article may help a few of you to get valuable knowledge and learn this LabVIEW application tool. 

[Related article:Labview interview questions]

Categories

SAP

Request for more information

Webinar

Python tutorial for beginners

5th April | 08:00 AM

150 Registered

Mudassir
Mudassir
DevOps ERP and IAM tools
Mudaasir is a programming developer for hkr trainings. He has a well knowledge of today’s technology and I’ve loved technology my entire life. And also been lucky enough to work for the programmer including science and technology. Big thanks to everyone who has followed me on LinkedIn and twitter.

WhatsApp
To Top