taret - intro to labview - exercises

8
 University of Maribor Faculty of Electrical Engineering and Computer Science Smetanova ulica 17, 2000 Maribor Slovenia INSTITUTE Of ROBOTICS February, 2007 Introduction to LabVIEW  Author: Darko Hercog Contact: [email protected] Project: TARET Winter School Introduction to LabVIEW  Exercises  

Upload: teta1234

Post on 06-Apr-2018

234 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Taret - Intro to LabVIEW - Exercises

8/2/2019 Taret - Intro to LabVIEW - Exercises

http://slidepdf.com/reader/full/taret-intro-to-labview-exercises 1/8

 

University of MariborFaculty of Electrical Engineering and Computer ScienceSmetanova ulica 17, 2000 MariborSloveniaINSTITUTE Of ROBOTICS 

February, 2007 Introduction to LabVIEW  

Author: Darko Hercog

Contact: [email protected]

Project: TARET Winter School

Introduction to LabVIEW Exercises 

Page 2: Taret - Intro to LabVIEW - Exercises

8/2/2019 Taret - Intro to LabVIEW - Exercises

http://slidepdf.com/reader/full/taret-intro-to-labview-exercises 2/8

TABLE OF CONTENT   i 

TABLE OF CONTENT

1 .  LABVI EW EXERCI SES..... . . . . . . . .. . . . . . . . . . . . .. . . . . . . . . . . .. . . . . . . . . . . . .. . . . . . . . . . . . .. . . . . . . . . . . . .. . . . . . .1  

1.1.  EXERCISE 1 (CONVERT C TO F) ............................................................................. 1 1.2.  EXERCISE 2 .................................................................................................... 1 1.3.  EXERCISE 3 (THERMOMETER) ................................................................................ 1 1.4.  EXERCISE 4 (TEMPERATURE MONITOR)..................................................................... 2 1.5.  EXERCISE 5 (TEMPERATURE ANALYSIS)..................................................................... 3 

Page 3: Taret - Intro to LabVIEW - Exercises

8/2/2019 Taret - Intro to LabVIEW - Exercises

http://slidepdf.com/reader/full/taret-intro-to-labview-exercises 3/8

TABLE OF FIGURES  ii 

TABLE OF FIGURES

Figure 1: Convert C to F - front Panel.......................................................................... 1 Figure 2: Convert C to F - block Diagram..................................................................... 1 Figure 3: Convert C to F – icon................................................................................... 1 Figure 4: Convert C to F – connector........................................................................... 1 Figure 5: Thermometer - front panel........................................................................... 2 Figure 6: Thermometer - block diagram ...................................................................... 2 Figure 7: Thermometer - connector pane..................................................................... 2 Figure 8: Temperature Monitor - front panel ................................................................ 3 Figure 9: Temperature Monitor - block diagram ............................................................ 3 Figure 10: Temperature Analysis - front panel .............................................................. 4 Figure 11: Temperature Analysis - block diagram.......................................................... 4 

Page 4: Taret - Intro to LabVIEW - Exercises

8/2/2019 Taret - Intro to LabVIEW - Exercises

http://slidepdf.com/reader/full/taret-intro-to-labview-exercises 4/8

CHAPTER 1: LABVIEW EXERCISES  1

 

1. LabVIEW exercises

1.1. Exercise 1 (Convert C to F) 

Create VI that will take a numeric value representing degrees Celsius and converts it to

degrees Fahrenheit (Figure 1 and Figure 2). Save VI as “Convert C to F.vi”.

Figure 1: Convert C to F - f ront Panel 

Figure 2: Convert C to F - b lock Diagram 

List of functions

AddFunction palette > Numeric > Add

MultiplyFunction palette > Numeric > Add

1.2. Exercise 2 

Create icon (Figure 3) and connector (Figure 4) for virtual instrument created in Exercise 1

(Convert C to F.vi). Assign »Deg C« as input and »Deg F« as output.

Figure 3: Convert C to F – icon 

Figure 4: Convert C to F – connector 

1.3. Exercise 3 (Thermometer) 

Create virtual instrument that will acquire temperature from the sensor and show it in

Temperature indicator on the VI front panel (Figure 5). The sensor returns a voltage

Page 5: Taret - Intro to LabVIEW - Exercises

8/2/2019 Taret - Intro to LabVIEW - Exercises

http://slidepdf.com/reader/full/taret-intro-to-labview-exercises 5/8

CHAPTER 1: LABVIEW EXERCISES  2

 

proportional to temperature. For example, if the temperature is 23 °C, the sensor output

voltage is 0.23 V. Create also an icon and connector for this VI (Figure 7).

Figure 5: Therm ometer - front panel 

Figure 6: Thermometer - block diagram 

Figure 7: Thermom eter - connector pane  List of SubVIs and functions

(Demo) Read Voltage.viFunction palette > User Libraries > Basic 1 Course > (Demo) Read Voltage.vi

Convert C to F.viVI from previous example

SelectFunction Palette > Comparison > Select 

MultiplyFunction Palette > Numeric > Add

1.4. Exercise 4 (Temperature Monitor) 

Create temperature monitor LabVIEW application. Create VI that will acquire temperature

every 500 mili seconds temperature and displays it on the waveform chart (Figure 8).

Page 6: Taret - Intro to LabVIEW - Exercises

8/2/2019 Taret - Intro to LabVIEW - Exercises

http://slidepdf.com/reader/full/taret-intro-to-labview-exercises 6/8

CHAPTER 1: LABVIEW EXERCISES  3

 

Figure 8: Temperature Monitor - front panel 

Figure 9: Temperature Monitor - block diagram 

List of SubVIs and functions 

Thermometer.viVirtual instrument from previous example

Wait Until Next ms MultipleFunction Palette > Timing > Wait Until Next ms Multiple

1.5. Exercise 5 (Temperature Analysis) 

Create VI that measures temperature every 0.1 s for 4 s. During the acquisition, the VI

should display the measurements in real time on a waveform chart. After the acquisition is

complete, the VI must plots the data on a graph and calculates the minimum, maximum,

and average temperatures and present them on VI front panel indicators.

Page 7: Taret - Intro to LabVIEW - Exercises

8/2/2019 Taret - Intro to LabVIEW - Exercises

http://slidepdf.com/reader/full/taret-intro-to-labview-exercises 7/8

CHAPTER 1: LABVIEW EXERCISES  4

 

Figure 10: Temperature Analysis - front panel  

Figure 11: Tem peratur e Analysis - block diagram  

List of SubVIs and functions

Thermometer.viVirtual instrument from Exercise 3

Page 8: Taret - Intro to LabVIEW - Exercises

8/2/2019 Taret - Intro to LabVIEW - Exercises

http://slidepdf.com/reader/full/taret-intro-to-labview-exercises 8/8

CHAPTER 1: LABVIEW EXERCISES  5

 

Mean.viFunction Palette > Mathematics > Probability & Statistics > Mean

Array Min MaxFunction Palette > Array