Professional Documents
Culture Documents
J Component: Measurement and Instrumentation
J Component: Measurement and Instrumentation
J Component: Measurement and Instrumentation
(EEE2004)
REVIEW-3
J COMPONENT
“INTRODUCTION TO LABVIEW”
1 INTRODUCTION TO LABVIEW 3
2 BENEFITS 4
4 BASIC OPERATIONS 6
5 FOR LOOP 10
6 WHILE LOOP 13
4 CASE STRUCTURES 15
5 CONCLUSIONS 19
6 REFERENCES 20
2
INTRODUCTION TO LABVIEW
• Programming languages such as C, C++, BASIC use functions and subroutines LabVIEW
uses VI
LabVIEW has the flexibility of a programming language combined with built-in tools
designed specifically for test, measurement, and control, you can create applications
that range from simple temperature monitoring to sophisticated simulation and control
systems.
3
BENEFITS
• Graphical user interface: Design professionals use the drag-and-drop user interface library
by interactively customizing the hundreds of built-in user objects on the control’s palette.
• Modular design and hierarchical design: Run modular LabVIEW VIs by themselves or
as subVIs and easily scale and modularize programs depending on the application.
• Multi platforms: The majority of computer systems use the Microsoft Windows operating
system. LabVIEW works on other platforms like Mac OS, Sun Solaris and Linux. LabVIEW
applications are portable across platforms.
• Reduces cost and preserves investment: A single computer equipped with LabVIEW is
used for countless applications and purposes—it is a versatile product. Complete
instrumentation libraries can be created for less than the cost of a single traditional,
commercial instrument.
4
LabVIEW PROGRAMMING BASICS
LabVIEW is a graphical programming language that uses icons instead of
lines of text to create applications. In contrast to text-based programming
languages, where instructions determine program execution, LabVIEW uses
dataflow programming, where the flow of data determines execution.
In LabVIEW, you build a user interface by using a set of tools and objects.
The user interface is known as the front panel. You then add code using
graphical representations of functions to control the front panel objects. The
block diagram contains this code. In some ways, the block diagram resembles
a flowchart.
5
BASIC OPERATIONS
Fig. 1: ADDITION
STEPS:
• Use block diagram panel to program
• Use Right click to get codes
• Follow Right click -Numeric-Add
• Place the Addition tool where we want
• Then Right click at node of input to addition tool
• Create Control at enter input
• Now create indicator by using right click at the output node at addition
pin
• Check whether the program is correct or wrong
• Run continuously if program is correct otherwise check the program
• Use Front panel to RUN...
• Enter inputs in the front panel
6
Fig. 2: SUBTRACTION
STEPS:
7
Fig. 3: MULTIPLICATION
STEPS:
• Use block diagram panel to program
• Use Right click to get codes
• Follow Right click -Numeric- Multiply
• Place the Multiplication tool where we want
• Then Right click at node of input to multiplication tool
• Create Control at enter input
• Now create indicator by using right click at the output node at
multiplication pin
• Check whether the program is correct or wrong
• Run continuously if program is correct otherwise check the program
• Use Front panel to RUN...
• Enter inputs in the front panel
8
Fig. 4: DIVISION
STEPS:
9
USING LOOPS
FOR LOOP
• The Count Terminal determines how many times the code inside the
loop will execute.
• The Iteration Terminal provides the current loop count starting with
zero.
10
EXAMPLE (1):
Sum of ‘N’ natural numbers using FOR Loop
11
EXAMPLE (2):
Calculate Factorial of numbers using FOR Loop
12
WHILE LOOP
• The Condition Terminal is used to exit the loop when the specified
condition is met.
• The Iteration Terminal provides the current loop count starting with
zero.
13
EXAMPLE (1):
Sum of N numbers using WHILE Loop
14
CASE STRUCTURES IN LABVIEW
Only one sub diagram is visible at a time, and the structure executes only
one case at a time. An input value determines which sub diagram executes.
The Case structure is similar to switch statements or if...then...else statements
in text-based programming languages.
You can add infinite number of conditions in your code and can easily
15
STEPS:
16
EXAMPLE 1:
To declare that Boolean expression is TRUE or FALSE
17
EXAMPLE 2:
Fig.13
3
Fig.14
Fig.13 &14 justify the use of Two Inputs and one Case Input in order to get
an Output
18
CONCLUSION
National Instruments LabVIEW and the integrated analysis functions it
provides, make up a powerful graphical application development
environment designed specifically for engineers and scientists. LabVIEW
provides solutions regardless of industry or area of focus within the
engineering process, from design and validation to production.
19
REFERENCES
• https://k12lab-support-pages.s3.amazonaws.com/lvbasichome8.html
• https://www.ni.com/en-in/support/documentation/supplemental/08/labview-for-loops-
and-while-loops-explained.html
• https://www.halvorsen.blog/documents/teaching/courses/labview_automation/labview
_basic.php
20