Lab 2 - City Tech OpenLab

advertisement
Department of Electrical &
Telecommunication Engineering
EET-3120/E260
Sensors and Instruments
Lab # 2
GRAPHICAL PROGRAMING IN LABVIEW
Name of the Students:
E-Mail:
Group Members
Section:
Date:
Submitted To:
0|Page
Faiz Rasool
Faiz.Rasool@mail.citytech.cuny.edu
Jonathan Rivera
Yivan Cortorreal
35142
03/04/2015
Vivian Vladutescu
Table of Content
Objective
2
Equipment
2
Theory
3
Procedure
4
Experimental Results
5-8
Analysis
9
Conclusion
9
1|Page
Equipment:
Computer.
Lab View software.
Objective:
In this lab experiment we will be familiarize with the graphical programming in Lab
View. Because programming in Lab VIEW is very different from programming in one of the
classical text-book programming languages. A Lab VIEW program is very similar to a logical
scheme in which graphical blocks are used instead of text.
2|Page
Theory:
Lab VIEW programs are called virtual instrument, or VIs, because their appearance and
operation imitate physical instruments, such as oscilloscopes and multimeters. Lab View
contains a comprehensive set of tools for acquiring analyzing, displaying, and storing data, as
well as tools to help you troubleshoot your code.
Lab View VIs contains three components-the front panel, the block diagram, and the icon
and connector pane. This lesson describes the front panel and block diagrams.
In Lab VIEW, you build a user interface, or front panel, with controls and indicators.
Controls are knobs, push buttons, dials, and other input device. Indicators are graphs, LEDs, and
other displays. After you build the user interface, you add code using VIs and structures to
control the front panel objects. The block diagram contains this code. In some ways, the block
diagram resembles a flowchart.
Fig 1. shows the typical programming of Lab VIEW on Front Panel & Block Diagram Panel
3|Page
PROCEDURE:
The Voltage.vi
For the first part of the experiment we created a simulation of a voltage ranging from
2.9 to 3.2. A random number generator was used to generate a number between 0 and 1. This
number was then multiplied by 0.3 and added to 2.9 which resulted in a number in the range of
2.9 to 3.2.
To build this voltage simulator, the following steps were performed:
1. A Meter indicator was moved from Express>>Numeric Indicators in the Controls Palette
and placed on a blank Panel. It was labeled Voltage. This is shown in Figure 1.
2. A Random Number (0-1) function was placed in the Diagram window from the Function
Palette.
3. From Express>>Arithmetic & Comparison>>Express Numeric in the Function Palette,
one multiply function, one Add function, and two Numeric Constant functions were
placed in the Diagram window. The Numeric Constants were given the values 2.9 and
0.3.
4. The connections were made as shown in Figure 2.
4|Page
Experimental results:
The Voltage. Vi
This results shows that we have a temperature sensor that gives out voltage that is proportional
with the temperature on the Celsius scale by using following equation:
Fig 2: The Panel and Diagram for the Voltage.vi
The Temperature.vi
These results shows voltage is proportional to the temperature in Kelvin. We use following
scale equations:
Kelvin
Celsius
Fahrenheit
5|Page
Fig 3: Connection of the Fahrenheit case structure
Fig 4 : Connection of the Celsius case structure
6|Page
Fig 5: Connection of the Kelvin case structure
Fig 6: Editing the Connector
7|Page
Fig 7: The panel and diagram for temperature measurement VI
8|Page
Analysis:
There were problem with wiring and in building the block diagrams. But we were able
solve that problem through friends.
Conclusion:
In conclusion, this lab introduces the LABVEIW graphical programming suite by
showing how students can use the Lab VIEW to represent the relationship between voltage and
temperature. We learn many things such as how to represent the voltage-temperature
relationship on the lab view through graphical representation.
9|Page
Download