You are on page 1of 5

LAB NO 1

OBJECTIVE:
Follow the instructions to get familiar with the NI LabVIEW software and to design a virtual
calculator to perform basic arithmetic operation using the software.

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 calculator program that will do the work of add, sub, multiply and
div.

STEPS OF CONSTRUCTION:
1. Select File» New to open a new front panel.
2. Create a numeric digital control. Use this control to enter the value of input number.

 Select the digital control on the Controls» Numeric Controls palette.


 Move the control to the front panel and click to place the control.
 Type (Input A, B and C) inside the label and click outside the label or click the Enter
button on the toolbar.
3. Create a numeric digital indicator. You will use this indicator to display the results.

 Select the digital indicator on the Controls» Numeric Indicators palette.


 Move the indicator to the front panel and click to place the indicator.
 Type (output Add, Sub and Div) inside the label and click outside the label or click the
Enter button.
4. Display the block diagram by clicking it or by selecting Window» Show Diagram.
5. Select the Multiply, addition, subtraction and division functions on the Functions» Numeric
palette and place them on the block diagram.
6. Use the Wiring tool to wire the icons.

 To wire from one terminal to another, use the Wiring tool to click the first terminal,
move the tool to the second terminal, and click the second terminal.
7. Display the front panel by clicking it or by selecting Window» Show Panel.
8. Enter a number in the digital control and run VI.

 Use the Operating tool or the Labeling tool to double-click the digital control and type a
new number.
 Click the Run button to run the VI.
 Try several different numbers and arithmetic operations and run the VI again.
9. Select File» Close to close the simple calculator VI.

RESULTS:
Task 1:

TASK NO 2:
Try to evaluate square root and square function or something else in this LabVIEW calculator in
addition to perform simple mathematical operations.

STEPS OF CONSTRUCTION:
Reciprocal function case
1. Select File» New to open a new front panel.
2. Create a numeric digital control.
3. Create a numeric digital indicator.
4. Display the block diagram by clicking it.
5. Now change the selector label to reciprocal, and from the Function Palette, select Numeric.
after this select reciprocal.
6. Use the Wiring tool to wire the icons.
 To wire from one terminal to another, use the Wiring tool to click the first terminal,
move the tool to the second terminal, and click the second terminal.
7. Click the Run button to run VI.
8. Try several different numbers and arithmetic operations and run the VI again.

RESULTS:
Task 2:

Conclusion
In conclusion, NI LabVIEW offers a user-friendly platform for creating basic calculators. It can
also utilize the concept to build a more complex calculator using more than two operands.

You might also like