Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

LAB NO 1

OBJECTIVE:
To get familiar...........

THEORY:
Short Introduction to LabVIEW

1 - Getting Started
LabVIEW programs are called Virtual Instruments, or VIs, because their appearance and
operation imitate physical instruments, such as oscilloscopes and multimeters. When opening
LabVIEW, you first come to the “Getting Started” window. Select “File → New VI (Ctrl + N)” to
get started.

2 - Front Panel vs. Block Diagram


Then, 2 different windows appear: The “Front Panel” and the “Block Diagram”. You use the
“Front Panel” to create your Graphical User Interface (GUI), while you use the “Block Diagram”
to create your code, i.e., the logic that makes your program works. Both the Front Panel and
the Block Diagram are saved in the same file (.vi).
You can easily switch between the “Front Panel” and the “Block Diagram” using “Ctrl + E”.

3 - Controls Palette and Functions Palette


When you right-click on the “Front Panel”, the “Controls Palette” appears. Here you will find all
the necessary elements you will need to create your GUI. When you right-click on the “Block
Diagram”, the “Functions Palette” appears. Here you will find all the functions you need to
create the logic in your program.

4 - Controls and Indicators


In LabVIEW we distinguish between “Controls” and “Indicators”. A “Control” is an element on
the Front Panel where the user can change the value (interact with it), while an “Indicator” is an
element only for information, i.e., the user cannot interact with it.

Task 1:
Create the following simple program that adds 2 numbers:

This simple calculator will add 2 numbers together.

STEPS OF CONSTRUCTION:
1.Front Panel:

Add 2 Numeric Controls and name them “Number1” and “Number2”

Add a Numeric Indicator and name it “Answer”

2.Block Diagram:
ADDITION CASE
From the Function Palette, select Numeric, and then select addition as shown in the figure
below.
Connect (wire) the different objects together like this:

Push the Run button in the Toolbar to do the calculations.

Subtraction case
Now change the selector label to Subtract, and from the Function Palette, select Numeric, and
then select Subtract as shown in the figure below.
Connect the input side of this block to the input nodes of the case structure and the output side
to the output node of the case structure.
Multiplication case
Now change the selector label to Multiply, and from the Function Palette, select Numeric, and
then select Multiply, as shown in the figure below.

Multiply block placement

Firstly, connect the input side of this block to the input nodes of the case structure. Then
connect the output side to the output node of the case structure.
Division case
Now change the selector label to Divide, and from the Function Palette, select Numeric. After
this, select Divide, as shown in the figure below.
Connect the input side of this block to the input nodes of the case structure and the output side
to the output node of the case structure.

3.Output of Calculator
On the front panel, enter two values into the input control of the LabVIEW calculator. Then,
select the operation to perform and run the VI. After that the screen shows the output of the
calculator.

TASK NO 2:
Try to evaluate square root and square function as well in this LabVIEW calculator in addition to
simple mathematical operations.

STEPS OF CONSTRUCTION:
Square function case
Now change the selector label to square, and from the Function Palette, select Numeric. After
this, select square, as shown in the figure below.
Connect the input side of this block to the input nodes of the case structure and the output side
to the output node of the case structure.

RESULTS:
Conclusion
In conclusion, this tutorial provides an in-depth overview of designing a basic calculator in
LabVIEW’s VI. It also covers a step-by-step explanation of designing a block diagram for this
purpose. This helps us better understand the concept of designing a basic calculator in
LabVIEW. It can also utilize the concept to build a more complex calculator using more than two
operands.

You might also like