Manual - Programming Through LabView Eeee
Manual - Programming Through LabView Eeee
LAB MANUALS
Version History
Version 1.0
Version 2.0
Faculty:
Dr.K.Srikanth, Mrs.K.Harija Rani, Mrs.K.Hemalalitha
Dr. O V S R Varaprasad, Mrs. A Susmitha, Mrs. V Chandrika
Asst. Professor(s), Dept. of EEE
List of Experiments:
1. Add, multiply, subtract and divide two numeric inputs.
2. Build a front panel/ block diagram for temperature conversion from Celsius to Fahrenheit
4. Create a VI to compute full adder logic using half adder logic as subVI.
7. Create a VI to animate a bird flying. Use the Picture Ring control to insert and display
pictures to be animated.
8. Create a global VI with a waveform chart and a stop button. Update the waveform chart
using a random number generator
9. Build a VI that displays sine and cosine plots on a waveform chart in sweep update mode.
10. Create a VI to calculate ncr and npr of a given number using a For Loop.
12. Create a VI to acquire voltage and current data of DC Machine/ simple electrical network
using DAQ 6341 module
13. Create a VI to format the date and time in the required format using Format Date/Time
String Function. Get the date and time input from Time Stamp Control.
14. Build a VI which finds the number of occurrences of a particular string in an array of
strings.
15.Build a VI to plot a circle in the XY graph using a For Loop.
16. Find the maximum and minimum values of the given sine waveform and the time at
which the waveform is maximum and minimum.
Experiment 1 : Add, multiply, subtract and divide two numeric inputs
1.1 Aim: To perform basic arithmetic operations like addition, subtraction, multiplication and
division using LabVIEW software from National Instruments (NI)
1.3 Procedure:
2. After launching LabVIEW, go to file (under menu bar) then select New VI or use shortcut
key ctrl+N.
3. Front panel and block diagram panels will pop up. Save the VI at preferred location in the
PC.
1. Functions>>Programming>>Numeric Palette>>Add
2. Place an " Add function " from Numeric palette on block diagram panel by following the
above procedure.
5.Create an indicator at the output terminal of "Add function" by right click at Output
terminal >> Create >>Indicator.
6. Runthe simulation.
Fig 1.1: Block Diagram & Front panel view of two variables addition in LabVIEW
environment
Fig 1.2: Block Diagram & Front panel view of two variables addition with control
inputs in LabVIEW environment
Note: Create control by right click at input terminals of “Add function” >> create >> control
1. Functions>>Programming>>Numeric Palette>>Subtract.
2. Follow the same steps as detailed in sec I.
Fig 1.3: Block Diagram & Front panel view of two variables subtraction in LabVIEW
environment
Fig 1.4: Block Diagram & Front panel view of two variables subtractionwith control
variables in LabVIEW environment
1. Functions>>Programming>>Numeric Palette>>Multiply
2. Follow the same steps as detailed in sec I.
Fig 1.5:Block Diagram & Front panel view of two variables multiplication in
LabVIEW environment
Fig 1.6:Block Diagram & Front panel view of two variables multiplication with
control inputs in LabVIEW environment
1. Functions>>Programming>>Numeric Palette>>Divide
2. Follow the same steps as detailed in sec I
Fig 1.7:Block Diagram & Front panel view of two variables Division in
LabVIEW environment
Fig 1.8:Block Diagram & Front panel view of two variables Division with control
inputs in LabVIEW environment
1.4 Precautions:
1. Ensure that all the functions used in block diagram panel are wired properly.
2. Save the design with proper name in prefered location of PC.
1.5 Conclusions:
Basic arithmetic operations like addition, subtraction, multiplication and division has been
performed using LabVIEW for both constant and control inputs.
1. Define LabVIEW ?
2. What are the advantages of LabVIEW ?
3. What are the two panels used in LabVIEW programming ?
4. What are the features of LabVIEW ?
5. What is the difference between control and indicators used in LabVIEW
programming ?
6. How LabVIEW is different from other softwares like MATLAB, PSCAD etc.?
1.7 Exercise:
1. Design a G-Code for the given equation and test the result for inputs x = 7, y=3, z= 2
2. Design a G-programming Code to Divide two numbers and find the remainder and
quotient
3. Design a G-programming code to find whether the given number is odd or even.
4. Design a G-programming Code to convert a given number in degree to radians
Experiment 2. Build a front panel/ block diagram for temperature
conversion from Celsius to Fahrenheit
2.1 Aim: To build a front panel/ block diagram for temperature conversion from Celsius to
Fahrenheit
2.3 Procedure:
2. After launching LabVIEW, go to file (under menu bar) then select New VI or use shortcut
key ctrl+N.
3. Front panel and block diagram panels will pop up. Save the VI at preferred location in the
PC.
2. To build VI , take a multiply function from Numeric Palette and place it on block diagram
panel.
4. Create control at other terminal (to input temperature in oC) by Right click at input
terminal>>Create>>Indicator
2.4 Precautions:
1. Ensure that all the functions used in block diagram panel are wired properly.
2. Save the design with proper name in prefered location of PC.
2.5 Conclusions:
VI Design for temperature conversion oC to oF has been completed and verified results
theoretically.
1. What are the differences between waveform chart and waveform graph ?
2.7 Exercise:
2. Design a VI to see the random numbers in the form of wave form graph for 100 no.of
samples ?
3. Design a G-Code to add and multiply more than two numeric inputs ?
Experiment 3: Perform Boolean operations
3.1: Aim: To perform logical operations like AND, OR, NOT, NAND and NOR using
LabVIEW software from National Instruments (NI)
3.3 Procedure:
2. After launching LabVIEW, go to file (under menu bar) then select New VI or use shortcut
key ctrl+N.
3. Front panel and block diagram panels will pop up. Save the VI at preferred location in the
PC.
The Boolean palette use the Boolean functions to perform logical operations on single
Boolean values or arrays of Boolean values. In Boolean logic, there are only two values, true
and false, represented by the numbers 1 and 0, respectively. Boolean logic is applied to
digital circuitry through the use of simple logic gates. There are seven of these gates: the
NOT, AND, OR, NAND, NOR, XOR, and XNOR gates.
I. AND operation
1. Functions>>Programming>>Boolean Palette>>And
2. Place an " And function " from Boolean palette on block diagram panel by following the
above procedure.
Fig 3.1: Image to show the location of Boolean palette
5. Create an indicator at the output terminal of "And function" by right click at Output
terminal >> Create >>Indicator.
Fig 3.1: Block Diagram & Front panel view of AND operation in LabVIEW
environment
Fig 3.2: Block Diagram & Front panel view of AND operation with controlled inputs in
LabVIEW environment
II. OR operation:
1. Functions>>Programming>>Boolean Palette>>Or
Fig 3.3: Block Diagram & Front panel view of OR operation in LabVIEW environment
Fig 3.4:Block Diagram & Front panel view of OR operation with control inputs in
LabVIEW environment
1. Functions>>Programming>>Boolean Palette>>Not
Fig 3.5: Block Diagram & Front panel view of Not operation in LabVIEW environment
Fig 3.6:Block Diagram & Front panel view of Not operation with control input in
LabVIEW environment
Fig 3.7: Block Diagram & Front panel view of NAND operation in LabVIEW
environment
Fig 3.8: Block Diagram & Front panel view of NAND operation with control inputs in
LabVIEW environment
Fig 3.9: Block Diagram & Front panel view of NOR operation in LabVIEW
environment
Fig 3.10: Block Diagram & Front panel view of NOR operation with control inputs in
LabVIEW environment
3.4 : Precautions:
1. Ensure that all the functions used in block diagram panel are wired properly.
2. Save the design with proper name in prefered location of PC.
3.5 : Conclusions:
Boolean operations like AND, OR, NOT, NAND and NOR have been performed using
LabVIEW for both constant and control inputs.
3. What are the 3 types of switch and latch behaviours used under boolean control palette ?
4. What are the truth tables of AND, OR, NAND and NOR gates?
4. Design a G-Code for AND, OR, NAND, NOR and NOT operations with two control
inputs?
Experiment 4: Create a VI to compute full adder logic using half adder
logic as subVI.
4.1 Aim: To design a full adder logic using half adder as subVI
4.3 Theory:
A combinational circuit that performs the addition of bits is called an Adder. Each computer
has an adder located in its CPU(ALU) that is responsible for the process of addition. There
are two types of Adder. They are also used in other parts of the processor, where they are
used to calculate addresses, table indices, increment and decrement operators, and similar
operations.
• Half Adder
• Full Adder
4.4 Procedure: Procedure to open new VI in LabVIEW:
2. After launching LabVIEW, go to file (under menu bar) then select New VI or use shortcut
key ctrl+N.
3. Front panel and block diagram panels will pop up. Save the VI at preferred location in the
PC.
3. Create control inputs x,y and place two indicators at output terminals of Exclusive Or ,
And functions for sum, carry outputs respectively.
Fig 4.2: Block Diagram & Front panel view of Full adder with Half adder as subVI
4.5 : Precautions:
1. Ensure that all the functions used in block diagram panel are wired properly.
2. Save the design with proper name in prefered location of PC.
4.6 : Conclusions:
Design of Full adder logic with half adder as subVI have been performed using LabVIEW.
4.7 : VIVA Questions:
4.8: Exercise:
2. Create a VI to find the average of two numbers and convert a section of VI into subVI?
5.3 Procedure:
2. After launching LabVIEW, go to file (under menu bar) then select New VI or use shortcut
key ctrl+N.
3. Front panel and block diagram panels will pop up. Save the VI at preferred location in the
PC.
5.4 Implementation:
To find the decimal equivalent of a binary number, first create the front panel and the
block diagram as given in Figures (a) and (b).
Then create the subVI called “Binary to decimal” and use it in the main VI as shown in
Figures (c) and (d).
5.5 : Precautions:
1. Ensure that all the functions used in block diagram panel are wired properly.
2. Save the design with proper name in prefered location of PC.
5.5 : Result: The VI to find the decimal equivalent of a binary number using subVI as per the
requirements has been developed.
References:
• Jerome, Jovitha. Virtual Instrumentation Using LabVIEW . PHI Learning. Kindle
Edition.
Experiment 6: Create a VI to evaluate a given circuit for values of current,
voltage.
6.1 Aim: Create a VI to evaluate a given circuit for values of current, voltage
6.3 Procedure:
2. After launching LabVIEW, go to file (under menu bar) then select New VI or use shortcut
key ctrl+N.
3. Front panel and block diagram panels will pop up. Save the VI at preferred location in the
PC.
6.4 Implementation:
To create a VI to evaluate a given circuit for values of current, voltage, first create the
front panel and the block diagram as given in Figures (a) and (b).
6.5 : Precautions:
1. Ensure that all the functions used in block diagram panel are wired properly.
2. Save the design with proper name in prefered location of PC.
6.6 : Result: The VI to evaluate a given circuit for values of current, voltage as per the
requirements has been developed.
Experiment 7: Create a VI to animate a bird flying. Use the Picture Ring
control to insert and display pictures to be animated.
7.1 Aim: Create a VI to animate a bird flying using the Picture Ring control to insert and
display pictures to be animated.
7.2 Software required:
PC installed with NI LabVIEW 2015
7.3 Procedure:
Procedure to open new VI in LabVIEW:
1. Navigate to Start» All Programs » National Instruments » LabVIEW 20**
2. After launching LabVIEW, go to file (under menu bar) then select New VI or use shortcut
key ctrl+N.
3. Front panel and block diagram panels will pop up. Save the VI at preferred location in the
PC.
4. Collect the bird flying sequence pictures to animate.
5. In the front panel, Controls >> Ring & Enum >> Pict Ring. Import the collected bird flying
sequence pictures one by one to the clip board from edit section. Import the pictures one by
one from clip board to the Pict Ring.
6. Open the Pict Ring in block diagram and place it inside the while loop and create a stop
control for the while loop.
7. In the block diagram select, Function >> Programming >> Numeric >> Quotient &
Remainder. Place the Quotient & Remainder inside the while loop and connect the iteration
“i” of the while loop to input 1 and insert the constant “No of bird flying sequence pictures”.
8. Connect the output of the Quotient & Remainder to the Pict Ring in the block diagram.
9. In the block diagram select, Function >> Programming >> Timing >> wait (ms). Connect a
control knob to wait (ms) in the front panel and set the wait from 100 to 200 ms.
10. Run the VI and check the animation of a bird flying using the Picture Ring control.
7.4 Implementation:
Create a VI to animate a bird flying using the Picture Ring control to insert and display
pictures to be animated, first create the front panel and the block diagram as given in Figures
12 (a) and (b).
Fig. (a) Front panel vi Fig. (b) Block Diagram vi
7.5 : Precautions:
1. Ensure that all the functions used in block diagram panel are wired properly.
2. Save the design with proper name in prefered location of PC.
7.6 : Result: The VI to animate a bird flying using the Picture Ring control to insert and
display pictures to be animated has been developed.
Experiment-8: Create a global VI with a waveform chart and a stop
button. Update the waveform chart using a random number generator
8.1 Aim: Create a global VI with a waveform chart and a stop button. Update the waveform
chart using a random number generator
8.3 Procedure:
2. After launching LabVIEW, go to file (under menu bar) then select New VI or use shortcut
key ctrl+N.
3. Front panel and block diagram panels will pop up. Save the VI at preferred location in the
PC.
8.4 Implementation:
To create a global VI with a waveform chart and a stop button and to update the waveform
chart using a random number generator, first create the front panel and the block diagram as
given in Figures (a) and (b).
8.5 : Precautions:
1. Ensure that all the functions used in block diagram panel are wired properly.
2. Save the design with proper name in prefered location of PC.
8.6 : Result: The global VI with a waveform chart and a stop button as per the requirements
has been developed.
Experiment 11: Build a VI to find the sum and product of array elements
11.1 Aim: Build a VI to find the sum and product of array elements.
11.3 Procedure:
2. After launching LabVIEW, go to file (under menu bar) then select New VI or use shortcut
key ctrl+N.
3. Front panel and block diagram panels will pop up. Save the VI at preferred location in the
PC.
11.4 Implementation:
To find the sum and product of array elements, first create the front panel and the
block diagram as given in Figures (a) and (b).
11.5 : Precautions:
1. Ensure that all the functions used in block diagram panel are wired properly.
2. Save the design with proper name in prefered location of PC.
11.6 : Result: The VI to find the sum and product of array elements as per the requirements
has been developed.
References:
• Jerome, Jovitha. Virtual Instrumentation Using LabVIEW . PHI Learning. Kindle
Edition.
Experiment 12: Create a VI to acquire voltage and current data of DC
Machine/ simple electrical network using DAQ 6341 module
12.1 Aim: Create a VI to acquire voltage, current and power data in a 1-phase AC source
feeding resistive load using DAQ 6341 module
1. Make connections on test bench for a circuit of a 1-phase AC source feeding resistive
load, such that the load voltage, load current, input power are measured using the
transducers on the test bench.
2. Connect the BNC terminals corresponding to all the transducers to BNC analog input
terminals of DAQ. (use any terminals among analog inputs: 1-13).
3. After building the VI in LabVIEW (Refer ‘Procedure wrt DAQ’ below), give 3-
phase supply to the test bench being worked on.
4. Make sure that autotransformer is not in bypass mode and that the variac is at a
position corresponding to minimum voltage.
5. Verify that the load switch is at position ‘0’.
6. Switch on the AC breaker, followed by closing the 415 V “AC isolator”.
7. Increase the input supply voltage gradually by varying the variac position of the
autotransformer.
8. Change the position of “load switch” from position ‘0’ to position ‘1’.
9. Run the VI corresponding to the experiment in the PC and observe the waveforms of
voltages, currents and power.
10. Verify the readings shown on the front panel with those of the digital meters of test
bench.
11. Tabulate the readings as shown the Table below.
Fig. (a) Sample VI for measurement of a voltage, current, power : Block Diagram
Fig. (b) Sample VI for measurement of a voltage, current, power: Front Panel
Table
S.No. Load Input Power (kW) Load Voltage (V) Load Current
Position
Digital DAQ Digital DAQ Digital DAQ
Meter Reading Meter Reading Meter Reading
Reading Reading Reading
12.4 Conclusions
Digital measurement of Voltage, current, power in a 1-phase AC source feeding
resistive load have been measured using PC-NI DAQ 6341 hardware and LabVIEW
software
Experiment-13: Create a VI to format the date and time in the required
format using Format Date/Time String Function. Get the date and time
input from Time Stamp Control.
13.1 Aim: Create a VI to format the date and time in the required format using Format
Date/Time String Function. Get the date and time input from Time Stamp Control.
13.3 Procedure:
2. After launching LabVIEW, go to file (under menu bar) then select New VI or use shortcut
key ctrl+N.
3. Front panel and block diagram panels will pop up. Save the VI at preferred location in the
PC.
5. Add the input controls for Time format string, Time stamp and add indicator to the output
of Format Date/Time string function block.
6. In the Time stamp on the front panel, give the present date and time.
7. Give the required format for date and time in time format string on the front panel.
The default format is: %m / %d / %Y %H: %M: %S. To include the milliseconds,
append %3u to the end of the string: %m / %d / %Y %H: %M: %S %3u.
8. Run the VI and check the result of date and time in the required format in the indicator.
13.4 Implementation:
To create a VI to format the date and time in the required format using Format Date/Time
String Function, first create the front panel and the block diagram as given in Figures (a)
and (b).
Fig. (a) Front panel vi Fig. (b) Block Diagram vi
13.5: Precautions:
1. Ensure that all the functions used in block diagram panel are wired properly.
2. Save the design with proper name in prefered location of PC.
13.6: Result:
The VI to format the date and time in the required format using Format Date/Time String
Function as per the requirements has been developed.
References:
• Jerome, Jovitha. Virtual Instrumentation Using LabVIEW . PHI Learning. Kindle
Edition.
Experiment- 15: Build a VI to plot a circle in the XY graph using a For
Loop.
15.1 Aim: Build a VI to plot a circle in the XY graph using a For Loop.
15.3 Procedure:
2. After launching LabVIEW, go to file (under menu bar) then select New VI or use shortcut
key ctrl+N.
3. Front panel and block diagram panels will pop up. Save the VI at preferred location in the
PC.
15.4 Implementation:
To Build a VI to plot a circle in the XY graph using a For Loop, first create the front panel
and the block diagram as given in Figures (a) and (b).
1. Ensure that all the functions used in block diagram panel are wired properly.
2. Save the design with proper name in prefered location of PC.
15.6 : Result: The VI to plot a circle in the XY graph using a for loop as per the requirements
has been developed.
References:
• Jerome, Jovitha. Virtual Instrumentation Using LabVIEW . PHI Learning. Kindle
Edition.
Experiment-16: Find the maximum and minimum values of the given sine
waveform and the time at which the waveform is maximum and minimum.
16.1 Aim: Create a VI to find the maximum and minimum values of the given sine waveform
and the time at which the waveform is maximum and minimum.
16.3 Procedure:
2. After launching LabVIEW, go to file (under menu bar) then select New VI or use shortcut
key ctrl+N.
3. Front panel and block diagram panels will pop up. Save the VI at preferred location in the
PC.
4. Programming >> Waveform >> Analog Waveform >> Waveform Generation >> Sine
Waveform.
5. Right click on the Sine waveform Block and disable the ‘View as Icon’ so that all the input
and output terminals of the Sine block will be visible.
6. Next insert the Min & Max block in the similar way as before and connect to the Signal
output terminal of Sine waveform Block.
7. Then add the required Controls to Sine waveform Block, required Indicators to Min &
Max block and a Waveform Graph as shown in the block diagram.
8. Run the VI and observe the sine waveform for different phase and frequency values. Also
observe the Maximum and minimum amplitude values of generated sine waveform and
corresponding time at which these maximum and minimum values occur.
16.4 Implementation:
To create a VI to find the maximum and minimum values of the given sine waveform and
the time at which the waveform is maximum and minimum, first create the front panel and
the block diagram as given in Figures (a) and (b).
Fig. (a) Front panel vi Fig. (b) Block Diagram vi
16.5 : Precautions:
1. Ensure that all the functions used in block diagram panel are wired properly.
2. Save the design with proper name in prefered location of PC.
16.6 : Result: The VI to find the maximum and minimum values of the given sine waveform
and the time at which the waveform is maximum and minimum as per the requirements has
been developed.