EET 3120 lab#2 - City Tech OpenLab

advertisement
New York City College
of Technology
Department of Electrical and
Telecommunications Engineering
Technology
EET 3120-E260[35142]
Experiment #2
Graphical Programing in LABVIEW
Student
Professor.
David R. Perez Ramos
Viviana Vladutescu
Team members
Damian Robinson
Shawn Clarke
March 05, 2015
Page 1
Contents
Introduction: ................................................................................................................................................. 3
Theoretical Background ................................................................................................................................ 3
Procedure:..................................................................................................................................................... 3
Analysis: ................................................................................................................................................... 4-11
Conclusion: .................................................................................................................................................. 12
References: ................................................................................................................................................. 13
Page 2
Introduction:
In this Lab will learn how to do graphical programing in Lab VIEW. Graphical blocks in Lab
VIEW are called icons. These icons can be used to do different applications. This lab will focus
on using those icons to measure voltages and temperature. We will learn how to use For and
While loop after create our voltage meter and temperature indicators.
Theoretical Background
In this experiment we will use graphical blocks (icons) to create meter indicator to measure
temperature and voltage. These icons have different functions depending on the association with
the Lab VIEW functionalities.
Icons associated with objects from the panel: allow input and output for the program.
Icons associated with functions: allow application of simple or complex operations to data.
Icons associated with subVIs: modulate and encapsulate the programs.
For temperature purpose Lab VIEW will use the following conversion equations:
tKUV*a = Kelvin
t CUV*a 273.15 = Celsius
t F (UV*a)*1.8459.67 = Fahrenheit
Procedure:
As we stated before this lab will focus on read voltage and temperature. Considering that the
read voltage is proportional to the temperature in Kelvins. We will start by creating a voltage
meter indicator and then use it in conjunction with the temperature meter to see their
relationship. This will verify our statement that voltage is proportional to the temperature.
.
Page 3
Analysis:
Image#1 – Front Panel: Voltage meter indicator
Here we created our voltage meter indicator in the front panel. This will be connected with the
circuit that will create in the block diagram window. This voltage indicator will tell us the
voltage generated by the circuit in the block diagram. In this image the voltage indicator was
already connected to the circuit in the block diagram and the application was running. That is
why we see that the needle is between 2 and 4. We will save this VI application to use it later in
conjunction with the temperature application.
Page 4
Image#2- Block Diagram: circuit connected to voltage meter indicator
Here we have created the circuit using random number function, multiply and add functions, and
numeric constant. All of these functions come from the controls palette under the Express»
Numeric Indicators.
By connecting the front panel with the block diagram using a connector (
), (
) with can
run the application to see how it generated voltage based on the values assigned in the numeric
constants.
Page 5
Image#3 – Front Panel: Measuring Temperature
We now will create another VI application to measure temperature using more icons in Lab
VIEW.
In here we have inserted some indicator that will be used to measure temperature. In here we
used Enum control function for the scale select window, numeric control and numeric indicator
functions for the voltage, temperature and scale. All of these are in the front panel window.
Image#4 – Block Diagram: Temperature case structure diagram
Kelvin Case Structure
Page 6
Celsius and Fahrenheit Case Structure
Here we are using the Enum control function for the scale, numeric control and numeric
indicator functions for the voltage, temperature. We added numeric constants functions and
multiply and subtract functions to complete the application.
In order for us to connect this block diagram with the front panel we have to create the connector
as we did in previous procedures. This connector (
), (
) are displayed on the
front panel right-top corner and from there we can wire it with the block diagram.
Connector
After creating this VI application we saved to combine it with the previous voltage VI.
Page 7
Image#5: Front Panel and Block Diagram for Temperature Measurements VI
Temperature in Kelvin
Temperature Fahrenheit
Page 8
Temperature in Celsius
Combining the two VI created before, we created an application that simulates the temperature
measurements. As we changed the scale select from Kelvin to Celsius or Fahrenheit the
application converts the temperature values from Kelvin to Celsius, Kelvin to Fahrenheit, Celsius
to Kelvin and viseversa.
Using the For and While loops
The For and While loops are used in LabVIEW just as in text-based programming languages. We
made an application that makes a finite number of temperature measurements and gives a
graphical representation of the temperature values.
In the next images we will see how the For loop is applied in the front panel and block diagram.
We increased the No. of Measurements to 20 and ran the program. This make the graph indicator
show the No. Measurements value depending on the temperature value.
In the Block Diagram we can see how is the For loop constructed using the two previous VI
application created.
Page 9
Image#6: Front Panel – For loop
Block Diagram: For loop
Page 10
Image#7: Front Panel – While loop
Block Diagram: While loop
The while loop, is an infinite repetitive structure that won’t stop until with press the stop button.
When we ran the application, the chart started to display a line going up and down (image#7)
with a delay of two seconds. While the application is running the front panel is recoding the
temperature value as the line move up a down. In the block diagram you can see how the
structure of the while loop is constructed.
Page 11
Conclusion:
This lab was very interesting because we learned how this Lab VIEW software can create useful
application using graphical programing. Learning how to use graphical icons was very important
because it teach us where the locations of these icons are and how they operate in the front panel
and block diagram. Building these types of applications give us experience to do future
experiment faster and with more understanding of the Lab VIEW software.
Page 12
References:
Laboratory Manual EET 3120 (Spring 2015) . by Prof. Viviana Vladutescu
Page 13
Download