0% found this document useful (0 votes)
184 views64 pages

Emi Practical Notes

This document provides instructions for several experiments using LabVIEW to create virtual instruments (VIs). The experiments include: (1) converting between Celsius, Fahrenheit and radians, (2) using a case structure to create a temperature converter, (3) converting 4-bit binary coded decimal to gray code, (4) creating a half adder, and (5) using a half adder subVI to create a full adder. Additional experiments include: (6) calculating the factorial of a number using a for loop and shift register, (7) calculating the sum of natural numbers, (8) decimal to binary conversion using a for loop, and (9) determining if a number is prime. Step-by-
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
184 views64 pages

Emi Practical Notes

This document provides instructions for several experiments using LabVIEW to create virtual instruments (VIs). The experiments include: (1) converting between Celsius, Fahrenheit and radians, (2) using a case structure to create a temperature converter, (3) converting 4-bit binary coded decimal to gray code, (4) creating a half adder, and (5) using a half adder subVI to create a full adder. Additional experiments include: (6) calculating the factorial of a number using a for loop and shift register, (7) calculating the sum of natural numbers, (8) decimal to binary conversion using a for loop, and (9) determining if a number is prime. Step-by-
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 64

ELECTRONICS INSTRUMENTATION AND MEASUREMENTATION

PRACTICAL NOTES

EXPERIMENT-1

AIM :- To create a VI and build a sub VI that converts and :


(1) Celsius into Fahrenheit
(2) Degree into9 Radians
(3) Use case structure to create a temperature converter
(4) 4 bit BCD to gray code
(5) Half adder (HA)
(6) Use subVI of HA to create a full adder

Software Required: LabVIEW (Virtual Instrumentation Lab)

Theory : :- LabVIEW offers a graphical programming approach that helps you visualize every aspect
of your application, including hardware configuration, measurement data, and debugging. This
visualization makes it simple to integrate measurement hardware from any vendor, represent
complex logic on the diagram, develop data analysis algorithms, and design custom engineering user
interfaces.

A LabVIEW program consists of one or more virtual instruments (VIs). Virtual instruments are called
such because their appearance and operation often imitate actual physical instruments. However,
behind the scenes, they are analogous to main programs, functions, and subroutines from popular
programming languages like C or Basic. Hereafter, we will refer to a LabVIEW program as a "VI"
(pronounced "vee eye," NOT the Roman numeral six). Also, be aware that a LabVIEW program is
always called a VI, whether its appearance or function relates to an actual instrument or not.

A VI has three main parts: a front panel, a block diagram, and an icon.

LabVIEW offers more flexibility than standard laboratory instruments because it is software-based.
You, not the instrument manufacturer, define instrument functionality. Your computer, plug-in
hardware, and LabVIEW comprise a completely configurable virtual instrument to accomplish your
tasks. Using LabVIEW, you can create exactly the type.of virtual instrument you need, when you
need it, at a fraction of the cost of traditional instruments.

Procedure:- (1) Celsius to Farenheit:


(1) Start the Lab view and select the blank VI.
1. Go to the Front Panel and right click on it.

2. Go to Controls -> Modern -> Numeric -> Thermometer.


3. Select Thermometer and place it on the “Front Panel”.
4. Change its name from “Thermometer” to “Fahrenheit”.

5. Go to Controls -> Modern -> Numeric ->Vertcal Point Slider.


6. Change its name from “Slide” to “Celsius”.

7. Now, go to the Controls -> Modern -> Numeric -> Numeric Indicator.
8. Change its name to “Celsius”
9. Now, go to Controls -> Modern -> Numeric -> Numeric Indicator
10. Name it as a Fahrenheit. Change its upper limit from “100” to “200” in order to observe the
results more accurately.

11. Now let’s move to the block diagram and design our small algorithm.
12. Go to Functions -> Express -> Arithmetic & Comparison -> Formula.
13. As you place this block on the “Front Panel” , you will see the figure.
14. Now Change the formula according to your requirements.

15. After changing the formula press “OK”.


16. And now, the “Block Diagram” window looks like the figure below.
17. Now, connect the “Celsius” with the “X1” terminal of the “Formula” block and connect
“Result” with the “Fahrenheit” block.

18. Now, the “Celsius” scale is converted into the “Fahrenheit ” scale.
19. Run the Program and you can see by changing the values of the “Celsius” the change occurs
in the values of the “Fahrenheit”.
(2) Degree to Radians:
1. Start the Lab view and select the blank VI.

2. Go to the Front Panel and right click on it.


3. Go to Controls ->Modern -> Numeric -> Numeric Controller.
4. Select Numeric and place it on the “Front Panel”.

5. Change its name from “Numeric” to “Degrees”.


6. Go to Controls -> Modern -> Numeric -> Numeric Indicator.

7. Change its name from “Numeric” to “Radians”.


8. Now let’s move to the block diagram and design our small algorithm.
9. Go to Functions -> Express -> Arithmetic & Comparison -> Formula.

10. As you place this block on the “Front Panel” , you will see the figure.
11. Now Change the formula according to your requirements.

12. After changing the formula press “OK”.


13. And now, the “Block Diagram” window looks like the figure below.
14. Now, connect the “Degree” with the “X1” terminal of the “Formula” block and connect
“Result” with the “Radians” block.

15. Now, the “Degree” scale is converted into the “Radians” scale.
16. Run the Program and you can see by changing the values of the “Degree” the change occurs
in the values of the “Radians”.

(c) Use case structure to create a temperature converter(0C to F and 0C to Kelvin):


1. Start the Lab view and select the blank VI.
2. Go to the Front Panel and right click on it.

3. Go to Controls -> Modern -> Numeric -> Thermometer.


4. Select Thermometer and place it on the “Front Panel”.
5. Change its name from “Thermometer” to “Fahrenheit”.

6. Go to Controls -> Modern -> Numeric ->Vertcal Point Slider.


7. Change its name from “Slide” to “Celsius”.

8. Now, go to the Controls -> Modern -> Numeric -> Numeric Indicator.
9. Change its name to “Celsius”
10. Now, go to Controls -> Modern -> Numeric -> Numeric Indicator
11. Name it as a Fahrenheit. Change its upper limit from “100” to “200” in order to observe
the results more accurately.

12. Now let’s move to the block diagram and design our small algorithm.
13. Go to Functions -> Express -> Arithmetic & Comparison -> Formula.
14. As you place this block on the “Front Panel” , you will see the figure.
15. Now Change the formula according to your requirements.

16. After changing the formula press “OK”.


17. And now, the “Block Diagram” window looks like the figure below.
18. Now, connect the “Celsius” with the “X1” terminal of the “Formula” block and connect
“Result” with the “Fahrenheit” block.

19. Now, the “Celsius” scale is converted into the “Fahrenheit ” scale.
20. Run the Program and you can see by changing the values of the “Celsius” the change
occurs in the values of the “Fahrenheit”.
21. Now go to Controls -> Boolean -> Vertical Toggle Switch.

22. Select Vertical Toggle Switch and place it on the “Front Panel”.
23. Now let’s move to the block diagram and design our small algorithm.
24. Go to Functions -> Structures -> Case Structures.
25. Select the Formula Area.

26. The value passed into the Case Selector terminal determines which case executes.
27. By default the case selector is a boolean data type and two cases exist True and False.
28. Connecting another data type to the case selector will automatically change it's data type.

29. Connect the Boolean Block with Case Structure.


30. Run the Program and you can see by changing the values of the “Celsius” the change
occurs in the values of the “Fahrenheit”.

31. When You turn of the “Switch” the farenheit scale will show same value as that of Celsius.
(4) 4 Bit BCD to Gray Code:
1. Start Labview and chose Blank VI.

2. Now from Control-> Modern-> Boolean select Vertical Toggle switches.


3. Now add 4 Vertical Toggle switches for entering 4 bit BCD input.

4. Now add 4 LED indicator for Gray code output.


5. Now in block diagram add 3 ExOR Gates.
6. Connect BCD1 to Gray1 and to EXOR gate 1.

7. Connect BCD2 to EXOR gate 1, the EXOR gate to Gray 2 and BCD2 to EXOR gate 2.
8. Connect BCD 3 to EXOR gate 2, the output of EXOR gate 2 to Gray 3 and BCD 3 to EXOR gate 3.

9. Connect BCD4 to EXOR gate 3 and the output of EXOR gate 3 to Gray4.
10. Run the program and see that on changing BCD input we get corresponding gray output.

(5) Half Adder:-


1.Run LabVIEW and choose blank VI.
2. Add 2 toggle switches and 2 LED.

3. Rename the Switches as Bit 1 and Bit 2 and the LED 1 as Sum and LED 2 as carry.
4. In Block diagram, add one EXOR gate and one and gate.

5. Connect Bit 1 and Bit 2 to both the gates.


6. Connect output of EXOR gate to Sum and the output of AND gate to Carry.

7. Run the program and the program will add two bits.
(6) Use subVI of half adder to create full adder:-
1.Run LabVIEW and choose blank VI.

2. Open the Half Adder VI.


3. In Front Panel add another switch for Carry In.

4. Now select the older circut in the diagram.


5. Now Click on create Sub VI.

6. A subVI is created.
7. Now create another VI by copying the orginal VI.

8. Now connect output 1 of original VI with input of second VI.


9. Now connect Carry in with second input of second VI.

10. Now add a OR gate.


11. Now join carry out of Sub VI 1 with OR gate.

12. Now join Sum output of SubVI 2 with LED.


13. Now join the carry out output of Sub VI2 with OR gate and the output of OR gatewith Carry out
LED.

14. Run the program and check the result.


EXPERIMENT-2

AIM:- To create a VI to find:


(7). Factorial of a number using FOR loop and Shift Register
(8). Sum of “N” Natural numbers
(9).Decimal to Binary conversion using FOR Loop
(10). Whether a given number is prime or not

Software Required:- LabVIEW 2018(Student Edition)

Theory:- LabVIEW offers a graphical programming approach that helps you visualize every aspect of
your application, including hardware configuration, measurement data, and debugging. This
visualization makes it simple to integrate measurement hardware from any vendor, represent
complex logic on the diagram, develop data analysis algorithms, and design custom engineering user
interfaces.

A LabVIEW program consists of one or more virtual instruments (VIs). Virtual instruments are called
such because their appearance and operation often imitate actual physical instruments. However,
behind the scenes, they are analogous to main programs, functions, and subroutines from popular
programming languages like C or Basic. Hereafter, we will refer to a LabVIEW program as a "VI"
(pronounced "vee eye," NOT the Roman numeral six). Also, be aware that a LabVIEW program is
always called a VI, whether its appearance or function relates to an actual instrument or not.

A VI has three main parts: a front panel, a block diagram, and an icon.
LabVIEW offers more flexibility than standard laboratory instruments because it is software-based.
You, not the instrument manufacturer, define instrument functionality. Your computer, plug-in
hardware, and LabVIEW comprise a completely configurable virtual instrument to accomplish your
tasks. Using LabVIEW, you can create exactly the type.of virtual instrument you need, when you
need it, at a fraction of the cost of traditional instruments.

PROCEDURE:- (7) Factorial of a number using FOR loop and Shift Register:
(1) Open LabVIEW 2018 and choose Blank VI.
(2) Add a NUMERIC CONTROL and NUMERIC INDICATOR.

(3) Now in Block Diagram, add a FOR LOOP from FUNCTIONS –> PROGRAMMING-> STRUCTURES->
FOR LOOP.
(4) Join NUMERIC CONTROL to LOOP COUNT.
(5) Now in the loop, Add a MULTIPICATOR and add SHIFT REGISTER .

(4) Now create a constant having value “1” and join it to left shift register.
(5) Now add an INCREMENT operator and join its Input to Loop Iteration and its output to one of the
inputs of MULTIPICATION.
(6) Now add a FEEDBACK NODE.
(7) Join FEEDBACK NODE to output and other input of MULTIPIER.

(8) Create a constant ‘1’ and join it to initialize terminal of FEEDBACK NODE.
(9) Now run theVI and the VI will give Factorial of a number.

(8) SUM of N Natural Numbers:


(1) Open LabVIEW 2018 and click on Blank VI.
(2) Add NUMERIC CONTROL and NUMERIC INDICATOR from CONTROLS-> MODERN-> NUMERIC.

(3) Now in Block Diagram add a WHILE LOOP.


(4) Now add a ADDITION OPERATOR.
(5) Add an INCREMENT OPERATOR in the loop and connect it to the ADDITION OPERATOR.

(6) Now add a FEEDBACK NODE and connect it to ADDITION OPERATOR.


(8) Now create another constant ‘0’ and connect it to Initializer Terminal of FEEDBACK NODE.

(10) Now add a Greater than or Equal to Operator and connect its output to Loop Condition.
(11) Join the NUMERIC CONTROL to the greater than equal to Operator.

(12) Now join the other input of the greater than equal to operator to the output of increment
operator.
(13) Run the VI and observe that the VI gives sum of n numbers.

(9) Decimal to Binary conversion using for loop:


(1) Open LabVIEW and Click on Create new VI.
(2)
EXPERIMENT-3

Aim:- To create :
(11) A 1D Array and Multiply is elements with a scaling factor and find the resultant array
(12) A 2D Array and find its Transpose

Software Required:- LabVIEW 2018( Student Version)

Theory:- LabVIEW offers a graphical programming approach that helps you visualize every aspect
of your application, including hardware configuration, measurement data, and debugging. This
visualization makes it simple to integrate measurement hardware from any vendor, represent
complex logic on the diagram, develop data analysis algorithms, and design custom engineering user
interfaces.

A LabVIEW program consists of one or more virtual instruments (VIs). Virtual instruments are called
such because their appearance and operation often imitate actual physical instruments. However,
behind the scenes, they are analogous to main programs, functions, and subroutines from popular
programming languages like C or Basic. Hereafter, we will refer to a LabVIEW program as a "VI"
(pronounced "vee eye," NOT the Roman numeral six). Also, be aware that a LabVIEW program is
always called a VI, whether its appearance or function relates to an actual instrument or not.

A VI has three main parts: a front panel, a block diagram, and an icon.

LabVIEW offers more flexibility than standard laboratory instruments because it is software-based.
You, not the instrument manufacturer, define instrument functionality. Your computer, plug-in
hardware, and LabVIEW comprise a completely configurable virtual instrument to accomplish your
tasks. Using LabVIEW, you can create exactly the type.of virtual instrument you need, when you
need it, at a fraction of the cost of traditional instruments.

Procedure:- (11) 1D Array and to multiply it with a scaling factor:


(1) Open LabVIEW and select create a blank VI.

(2) Now add Array from CONTROLS-> MODERN-> ARRAY, CLUSTER AND MATRIX.

(3) Now add another matrix from CONTROLS.


(4) Now add NUMERIC CONTROL in any MATRIX and add NUMERIC INDICATOR in other matrix. Make
sure the number of elements in first matrix is equal to number of elements in second matrix.

(5) Now add a MULTIPLICATION OPERATOR and connect its one input to first Array and its output to
second array.
(6) Now create a constant and connect it to other terminal of MULTIPLICATION OPERATOR.
(7) Now run the VI and see that the elements of first matrix gets scaled by the scaling factor and the
output is shown in the second matrix.

(12) A 2D array and find its transpose:-


(1) Open LabVIEW and click on Blank VI.
(2) Add 2 array from CONTROLS-> MODERN-> ARRAY, CLUSTER AND MATRIX.
(3) Now Add NUMERIC CONTROL in first array and NUMERIC INDICATOR in second array.

(4) Now right Click on First array and select ‘ADD DIMENSION’.
(5) Make both the Arrays 5x5 form.

(6) Now in Block Diagram, Add TRANSPOSE FUNCTION from PROGRAMMING->ARRAY->TRANSPOSE


2D ARRAY.
(7) Now join the first array to input and second array to output.

(8) You can run the program and observe that second matrix is the transpose of first matrix.

You might also like