0% found this document useful (0 votes)
5 views

Lab#1

1

Uploaded by

Net Frd
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)
5 views

Lab#1

1

Uploaded by

Net Frd
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/ 12

Department of Electrical & Computer Engineering

University of New Mexico at Albuquerque

ECE206 L
Experiment-1
The LabVIEW Programming Environment and Basic Operations

Spring 2024

Authors: A b d u l l a h
Alazmi
Ghazi Alazmi
Date:

1|Page
Table of Contents

Abstract.................................................................................................................................3
List of Figures.......................................................................................................................3
List of Tables.........................................................................................................................3
Background and Reference.................................................................................................3
Lab Procedure and Equipment...........................................................................................4
Procedure...........................................................................................................................................4
Program 1: Celsius (℃) to Fahrenheit (℉)....................................................................................5
Program 2: Fahrenheit (℉) to Celsius (℃)....................................................................................5
Program 3: Slope (𝑚) Calculator.....................................................................................................6
Theoretical Analysis.............................................................................................................7
Program 1, Celsius to Fahrenheit......................................................................................................7
Program 2: Fahrenheit to Celsius......................................................................................................7
Program 3: Slope Calculator.............................................................................................................7
Discussion..............................................................................................................................9

2|Page
Abstract

The main purpose of this lab is to familiarize the LabVIEW software and by using
the software develop a program for performing the following function:
 Conversion process between Fahrenheit and Celsius Degree temperatures and
vice versa.
 Develop a program for a line slope calculator.

List of Figures

Figure 1: Celsius to Fahrenheit LabVIEW Program


Figure 2: Fahrenheit to Celsius LabVIEW Program
Figure 3: Slope Calculator LabVIEW Program
Figure 4: Slope Calculator LabVIEW Program

List of Tables

TABLE 1: Results for Celsius to Fahrenheit Program


TABLE 2: Results for Fahrenheit to Celsius Program
TABLE 3: Results of the Slope Program

Background and Reference


Path:

 Lab Manual

References:
 Getting Started with LabVIEW.
https://www.ni.com/getting-started/labview-basics/environment

 LabVIEW Technical Resources:


https://www.ni.com/en-us/support.html
,

3|Page
Lab Procedure and Equipment

Equipment:
 Computer Desktop
 Windows 10 pro OS
 LabVIEW 2018 software
 Notebook, and pencil

Procedure:
1. Launched LabVIEW from Start >> Programs >> National Instruments >>
LabVIEW 2022>> LabVIEW 2022.
2. Clicked File >> New VI to open a new front panel.
3. Selected Window >> Tile Left and Right to display the front panel and block
diagram side by side.
4. Created a numeric digital control. used this control to enter the value for
degrees Centigrade.
5. Create a numeric indicator. You will use this indicator to display the value for
degrees Fahrenheit.
6. Displayed the block diagram by selecting Window >> Show Diagram.
7. Multiply and Add functions were selected on the Functions >>Numeric palette
and placed them on the block diagram.
8. Numeric constant were selected on the Functions >> Numeric palette and placed
two of them on the block diagram.
9. Typed 1.8 in one constant and repeated the process for a second constant of 32.0.
10. Used the Wiring tool to wire the icons in the block diagram.
11. Selected File >> Save. Type ConvertCtoF.vi in the dialog box. Clicked the Save
button to save the file.

13. The same steps were followed to Develop a Program to convert ℉ to ℃, and to
12. A number were entered in the numeric control to run the VI.

Develop a Program to Calculating the Slope of a Line but with a different number
of numeric digital controls.

4|Page
Program 1: Celsius (℃) to Fahrenheit (℉)
The formula for converting degrees Celsius to degrees Fahrenheit is as follows:

℉ = (℃ × 1.8) + 32

Here F represents the Fahrenheit and C represents the Celsius. This formula has been used
to program in LabVIEW’s software. This program is created using steps involve above to
made a conversion function of temperature from Celsius (℃) to Fahrenheit (℉).

Figure1: Celsius to Fahrenheit LabVIEW Program

Program 2: Fahrenheit (℉) to Celsius (℃)


The formula for converting degrees Fahrenheit to degrees Celsius is as follows:

℃ = (℉ − 32) ÷ 1.8

Here F represents the Fahrenheit and C represents the Celsius. This formula
has been used to program in LabVIEW’s software. This program is created using steps
involve in program 1, to made a conversion function of temperature from degrees
Fahrenheit to degrees Celsius.

Figure 2: Fahrenheit to Celsius LabVIEW Program


5|Page
Program 3: Slope (𝒎) Calculator
Using the techniques explained in Part 1, created a VI to calculate the slope of a line.
Then, transformed the code into a subVI using the Edit » Create SubVI method. The VI
saved as Slope.vi and saved the subVI as SlopeSub.vi.
The formula for the slope is as below:
y 2− y 2
m=
x 2−x 1

Figure 3: Slope Calculator LabVIEW Program

Slope calculator programmed in LabVIEW SubVI.

Figure 4: Slope Calculator LabVIEW SubVI


6|Page
Theoretical Analysis
Program 1, Celsius to Fahrenheit

℉ = (℃ × 1.8) + 32
Conversion Formula for Celsius to Fahrenheit is:

Example:
For 10℃
℉ = (10× 1.8) + 32=50℉
For -15℃
℉ = (-15× 1.8) + 32=5℉

Program 2: Fahrenheit to Celsius


Conversion Formula for Fahrenheit to Celsius is:
℃ = (℉ − 32) ÷ 1.8
Example:
For 50℉
℃ = (50 − 32) ÷ 1.8=10℃
For -112℉
℃ = (-112 − 32) ÷ 1.8=-80℃

𝑦2 − 𝑦1
Program 3: Slope Calculator

Slope Formula : Slope (m) =


𝑥2 − 𝑥1
Example:
For (1,1), (2,2) Slope (m) =(2-1)/(2-1)=1
Verification Results
Program 1: Celsius to Fahrenheit
Celsius ℃ (input) Calculated value (℉) Measured value (℉) Error % error

10℃ 50℉ 50℉


0 0
-15℃ 5℉ 5℉
0 0
-80℃ -112℉ -112℉
0 0
-40℃ -40℉ -40℉
0 0
-300℃ -508℉ -508℉
0 0
-273.15℃ -459.67℉ -459.67℉
0 0
The program is correct to converting of Celsius to Fahrenheit up to absolute zero. For above it shows erroneous

7|Page
result.

8|Page
Program 2: Fahrenheit to Celsius

Fahrenheit ℉ Calculated value (℃) Measured value (℃) Error % error

50℉ 10℃ 10℃


0 0
5℉ -15℃ -15℃
0 0
-112℉ -80℃ -80℃
0 0
-40℉ -40℃ -40℃
0 0
-500℉ -295.556℃ -295.556℃
0 0
-459.67℉ -273.15℃ -273.15℃
0 0

The program is correct to converting of Celsius to Fahrenheit up to absolute zero. For above it shows erroneous
result.

Program 3: Slope Formula

Point 1 Point 2 Slope

(1,1) (2,2) 1

(2,2) (1,1) 1

(2,3) (3,3) 0

(1,1) (1,2) inf

(1,2) (1,1) -inf

(1,2) (1,1) und

Results:

The lab was conducted to familiarize the LabVIEW software and by using
the software develop a program for converting Celsius to Fahrenheit and vice versa. A
program was also developed in the lab for calculating the slope of the line. From the
technical analysis it can be observed that a limiting factor required below absolute zero
on the temperature conversions in both Program 1 and Program 2. All other results are
correct for Program 1 and Program. The results obtained for the program 3 are as per

9|Page
theoretical calculation. All the results are tabulated in lab record.

10 | P a g e
Discussion

1. What is a VI? What are the three main parts of a VI? Briefly describe each.

A “VI” is stands for virtual instrument. A LabVIEW programs are called virtual
Instruments (VIs). It has three parts. These parts are as below:
 Front panel: It serves as the user interface.
 Block diagram: It contains the graphical source code that defines the functionality
of the VI.
 Icon and connector pane: It Identifies the VI so that VI can be used in another VI.
A VI within another VI is called a subVI. A subVI corresponds to a subroutine in
text-based programming languages.

2. What are the three palettes? Briefly describe each.

The three palettes are the tools, controls, and functions palette. The tool palette is
available on the front panel and the block diagram and it is used to operate and modify
front panel and block diagram objects. The controls palette is available only on the front
panel and it contains the controls and indicators used to create the front panel. The
functions palette is available only on the block diagram and it contains the VIs and
functions used to create the block diagram.

3. How is data passed in LabVIEW?

LabVIEW follows a dataflow model for running VIs. When a node completes
execution, it supplies its output data to its output terminals. This passes the output data
to the next node in the dataflow path.

4. How can you tell the difference between controls and indicators on the
front panel? On the block diagram?

The main difference between controls and indicator in front panel is that the controls
can be edited and indicators are where values are displayed in the front panel . The
difference is the same for the block program except for the controls have a switch next
11 | P a g e
to them to edit their values

5. Explain the two methods of creating a subVI


The two methods to create a sub VI are:

1. Highlight all functions that are needed in the subVI, right clicking and selecting the create
subVI option.

2. The second method is to create a standalone VI, and then dragging and dropping it into
another VIs block program.

12 | P a g e

You might also like