Lab View
Lab View
21EC384
III Semester
Name:
U SN:
Section: Batch:
1
LabVIEW Programming Basics-21EC384
INSTITUTE MISSION
To provide state of the art Infrastructure facilities.
To implement modern pedagogical methods in delivering the academic programs with
experienced and committed faculty.
To create a vibrant ambience that promotes Learning, Research, Invention and Innovation.
To undertake manpower and skill development programmes for Academic Institutions and
Industries.
To enhance Institute Industry Interface through Collaborative Research and Consultancy
To generate and disseminate knowledge through training
programme/workshops/seminars/conferences/publications.
To be a more comprehensive college in terms of the number of programs offered.
To relentlessly pursue professional excellence with ethical and moral values.
DEPARTMENT VISION
To develop outstanding Electronics and Communication Engineers to meet the ever changing
Social and Technological needs of the Society.
DEPARTMENT MISSION
MoD1 To provide State-of-the-Art infrastructure in Electronics and Communication Engineering.
To disseminate strong theoretical and practical exposure to meet the emerging trends in the
MoD2 industry.
MoD3 To promote a free thinking environment with innovative teaching-learning pedagogy.
To develop value based socially responsible professionals for the betterment of the
MoD4
Society.
2
LabVIEW Programming Basics-21EC384
II. PO AND PSO STATEMENT
3
LabVIEW Programming Basics-21EC384
LabVIEW Programming Basics
Course Code 21EC384 CIE Marks 50
Teaching Hours/Week (L: T:P: S) 0:0:2:0 SEE Marks 50
Credits 1 Exam Hours 03
Course objectives:
Aware of various front panel controls and indicators.
Connect and manipulate nodes and wires in the block diagram.
Locate various toolbars and pull-down menus for the purpose of implementing specific functions.
Locate and utilize the context help window.
Familiar with LabVIEW and different applications using it.
Run a Virtual Instrument (VI).
Sl.No VI Programs (using LabVIEW software) to realize the following:
1 Basic arithmetic operations: addition, subtraction, multiplication and division
2 Boolean operations: AND, OR, XOR, NOT and NAND
3 Sum of ‘n’ numbers using ‘for’ loop
4 Factorial of a given number using ‘for’ loop
12 Demonstrate how to create a basic VI which calculates the area and perimeter of a circle.
4
LabVIEW Programming Basics-21EC384
Introduction to LabVIEW
Front panel - Serves as the user interface. The front panel is the user interface of the VI.
The front panel is built with controls and indicators, which are the interactive input and
output terminals of the VI, respectively. Controls are knobs, pushbuttons, dials, and other
input devices. Indicators are graphs, LEDs, and other displays. Controls simulate
instrument input devices and supply data to the block diagram of the VI. Indicators
simulate instrument output devices and display data the block diagram acquires or
generates. After the front panel is build, add code using graphical representations of
functions to control the front panel objects. The block diagram contains this graphical
source code. Front panel objects appear as terminals on the block diagram.
5
LabVIEW Programming Basics-21EC384
Block diagram - Contains the graphical source code that defines the functionality of VI.
Icon and connector panel - Identifies the VI so that the VI can be used in another VI.
AVI within another VI is called a sub VI. A sub VI corresponds to a subroutine in text-
based programming languages. Additionally, the block diagram contains functions and
structures from built-in LabVIEW VI libraries. Wires connect each of the nodes on the
block diagram, including control and indicator terminals, functions, and structures.
LabVIEW Palettes-LabVIEW palettes give provide the options needed to create and editthe
front panel and block diagram. The Tools palette is available on the front panel and the block
diagram. A tool is a special operating mode of the mouse cursor. By selecting a tool, the
cursor icon changes to the tool icon. Use the tools to operate and modify front panel and
block diagram objects. Select Window » Show Tools Palette to display the Tools palette.
6
LabVIEW Programming Basics-21EC384
The Tools palette can be placed anywhere on the screen. If automatic tool selection is
enabled and as the cursor is moved over objects on the front panel or block diagram,
LabVIEW automatically selects the corresponding tool from the Tools palette.
The Controls palette: The Controls palette is available only on the front panel. The Controls
palette contains the controls and indicators used to create the front panel. To display the
Controls palette, Select Window » Show Controls Palette or right-click the front panel
workspace. The Controls palette can be placed anywhere on the screen.
The Functions palette: The Functions palette is available only on the block diagram. The
Functions palette contains the VIs and functions used to build the block diagram. To display
the Functions palette, select Window » Show Functions Palette or right-click the block
diagram workspace. The Functions palette can be placed anywhere on the screen.
7
LabVIEW Programming Basics-21EC384
Dataflow Programming: LabVIEW follows a dataflow model for running VIs. A block
diagram node executes when all its inputs are available. When a node completes execution, it
supplies data to its output terminals and passes the output data to the next node in the
dataflow path.
Procedure:
8
LabVIEW Programming Basics-21EC384
Arithmetic operations
Instructions:
Step 1: Select controls by right clicking on the front panel and choose the specific type of
control similarly choose indicators.
Step 2: Different operators such as addition, subtraction, multiplication, less than, greater
than, Boolean, etc can be performed by right clicking on block diagram.
Step 3: Using wires inputs and outputs are connected to the respective operators in the
block diagram panel.
9
LabVIEW Programming Basics-21EC384
10
LabVIEW Programming Basics-21EC384
11
LabVIEW Programming Basics-21EC384
EXPERIMENT NO : 02 DATE:
Boolean operations
Aim: To perform Boolean operations: AND, OR, XOR, NOT and NAND
Instructions:
Step 1: Select controls by right clicking on the front panel and choose the specific type of
control similarly choose indicators.
Step 2: Different operators such as addition, subtraction, multiplication, less than, greater
than, Boolean, etc can be performed by right clicking on block diagram.
Step 3: Using wires inputs and outputs are connected to the respective operators in the
block diagram panel.
12
LabVIEW Programming Basics-21EC384
13
LabVIEW Programming Basics-21EC384
EXPERIMENT NO : 03 DATE:
Instructions:
Step 1:First of all move to the front panel and press right then control palette and choose numeric option
place in the front panel and its correspondent will shown block diagram.
Step 2: Move to block diagrams press right then according to figure choose while loop in structure option.
Step 3: Now press right at the end of the while loop and select the shift register. according to the below figure.
Step 4: Select numeric button and choose constant and connect it to register shown below.
Step 5:Connect this numeric constant with the register
Step 6: Now select the increment option from the numeric tab.
Step 7 : Now will add the ending terminal of the while loop function means when our desired number will
come our function will stop.
Step 8: At right side shift register press right and select indicator from creates
Step 9: Now move to front panel and put the values of any N natural number and you will get the sum of
numbers till that number.
14
LabVIEW Programming Basics-21EC384
EXPERIMENT NO : 04 DATE:
Instructions:
Step 1:On the block diagram window, from the function palette select structures and then select for loop
Step 2:Connect the numeric control in which the user input will be stored to the N i.e. number of loops of for
loop
Step 3: we must have to initialize the shift register. From the function palette select numeric and then select
constant
Step 4: Place this numeric with the shift register and set its value to 1
Step 5:The other input of the multiply block we have to connect the incremented iteration because the number
of iterations start from 0 but we want the factorial from 1 onwards, because the factorial will turn out
to be zero otherwise From the function palette select numeric and then select increment
Step 6: At the input of this increment block connect the iterative index of the while loop, and connect the
output of this increment block to the remaining input of the add block. The resulting factorial
calculating block diagram will look like the one
.
Step 7 :At the right shift register click right and from the drop down select create and then select indicator
Step 8: The complete block diagram of the factorial calculating VI is shown in the figure below
15
LabVIEW Programming Basics-21EC384
EXPERIMENT NO : 05 DATE:
Instructions:
Step 1: Select controls by right clicking on the front panel and choose the specific type of
control similarly choose indicators.
Step 2: Different operators such as addition, subtraction, multiplication, less than, greater
than, Boolean, etc can be performed by right clicking on block diagram.
Step 3: Using wires inputs and outputs are connected to the respective operators in the
block diagram panel.
16
LabVIEW Programming Basics-21EC384
Instructions:
Step 1:On the block diagram window, from the function palette select structures and then select
While loop
Step 2:Connect the numeric control in which the user input will be stored to the N i.e. number of loops of for
While loop
Step 3: we must have to initialize the shift register. From the function palette select numeric and then select
constant
Step 4: Place this numeric with the shift register and set its value to 1
Step 5:The other input of the multiply block we have to connect the incremented iteration because the number
of iterations start from 0 but we want the factorial from 1 onwards, because the factorial will turn out
to be zero otherwise From the function palette select numeric and then select increment
Step 6: At the input of this increment block connect the iterative index of the while loop, and connect the
output of this increment block to the remaining input of the add block. The resulting factorial
calculating block diagram will look like the one
.
Step 7 :At the right shift register click right and from the drop down select create and then select indicator
Step 8: The complete block diagram of the factorial calculating VI is shown in the figure below
17
LabVIEW Programming Basics-21EC384
EXPERIMENT NO : 07 DATE:
Instructions:
Step 1: Select controls by right clicking on the front panel and choose the specific type of
control similarly choose indicators.
Step 2: Different operators such as addition, subtraction, multiplication, less than, greater
than, Boolean, etc can be performed by right clicking on block diagram.
Step 3: Using wires inputs and outputs are connected to the respective operators in the
block diagram panel.
18
LabVIEW Programming Basics-21EC384
EXPERIMENT NO : 08 DATE:
Instructions:
Step 1: Select controls by right clicking on the front panel and choose the specific type of
control similarly choose indicators.
Step 2: Different operators such as addition, subtraction, multiplication, less than, greater
than, Boolean, etc can be performed by right clicking on block diagram.
Step 3: Using wires inputs and outputs are connected to the respective operators in the
block diagram panel.
19
LabVIEW Programming Basics-21EC384
EXPERIMENT NO : 09 DATE:
Aim: To Build a Virtual Instrument that simulates a heating and cooling system. The system must be able
to be controlled manually or automatically.
Instructions:
Step 1: Select controls by right clicking on the front panel and choose the specific type of
control similarly choose indicators.
Step 2: Different operators such as addition, subtraction, multiplication, less than, greater
than, Boolean, etc can be performed by right clicking on block diagram.
Step 3: Using wires inputs and outputs are connected to the respective operators in the
block diagram panel.
20
LabVIEW Programming Basics-21EC384
EXPERIMENT NO : 10 DATE:
Aim: To Build a Virtual Instrument that simulates a Basic Calculator (using formula node).
Instructions:
Step 1: Select controls by right clicking on the front panel and choose the specific type of
control similarly choose indicators.
Step 2: Different operators such as addition, subtraction, multiplication, less than, greater
than, Boolean, etc can be performed by right clicking on block diagram.
Step 3: Using wires inputs and outputs are connected to the respective operators in the
block diagram panel.
21
LabVIEW Programming Basics-21EC384
EXPERIMENT NO : 11 DATE:
Instructions:
Step 1: Select controls by right clicking on the front panel and choose the specific type of
control similarly choose indicators.
Step 2: Different operators such as addition, subtraction, multiplication, less than, greater
than, Boolean, etc can be performed by right clicking on block diagram.
Step 3: Using wires inputs and outputs are connected to the respective operators in the
block diagram panel.
22
LabVIEW Programming Basics-21EC384
EXPERIMENT NO : 12 DATE:
Aim: To Demonstrate how to create a basic VI which calculates the area and perimeter of a circle.
Instructions:
Step 1: Select controls by right clicking on the front panel and choose the specific type of
control similarly choose indicators.
Step 2: Different operators such as addition, subtraction, multiplication, less than, greater
than, Boolean, etc can be performed by right clicking on block diagram.
Step 3: Using wires inputs and outputs are connected to the respective operators in the
block diagram panel.
23