You are on page 1of 8

University of Maribor

Faculty of Electrical Engineering and Computer Science


Smetanova ulica 17, 2000 Maribor
Slovenia
INSTITUTE Of ROBOTICS

Introduction to LabVIEW
Exercises

February, 2007

Author:

Darko Hercog

Contact:

darko.hercog@uni-mb.si

Project:

TARET Winter School

Introduction to LabVIEW

TABLE OF CONTENT

TABLE OF CONTENT

1.
1.1.
1.2.
1.3.
1.4.
1.5.

LABVIEW EXERCISES....................................................................................1
EXERCISE 1 (CONVERT C TO F) .............................................................................
EXERCISE 2 ....................................................................................................
EXERCISE 3 (THERMOMETER) ................................................................................
EXERCISE 4 (TEMPERATURE MONITOR) .....................................................................
EXERCISE 5 (TEMPERATURE ANALYSIS).....................................................................

1
1
1
2
3

TABLE OF FIGURES

ii

TABLE OF FIGURES

Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure
Figure

1: Convert C to F - front Panel..........................................................................


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

1
1
1
1
2
2
2
3
3
4
4

CHAPTER 1: LABVIEW EXERCISES

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 - front Panel

Figure 2: Convert C to F - block Diagram

List of functions
Add
Function palette > Numeric > Add
Multiply
Function 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

CHAPTER 1: LABVIEW EXERCISES

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: Thermometer - front panel

Figure 6: Thermometer - block diagram

Figure 7: Thermometer - connector pane

List of SubVIs and functions


(Demo) Read Voltage.vi
Function palette > User Libraries > Basic 1 Course > (Demo) Read Voltage.vi
Convert C to F.vi
VI from previous example
Select
Function Palette > Comparison > Select
Multiply
Function 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).

CHAPTER 1: LABVIEW EXERCISES

Figure 8: Temperature Monitor - front panel

Figure 9: Temperature Monitor - block diagram

List of SubVIs and functions


Thermometer.vi
Virtual instrument from previous example
Wait Until Next ms Multiple
Function 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.

CHAPTER 1: LABVIEW EXERCISES

Figure 10: Temperature Analysis - front panel

Figure 11: Temperature Analysis - block diagram

List of SubVIs and functions


Thermometer.vi
Virtual instrument from Exercise 3

CHAPTER 1: LABVIEW EXERCISES


Mean.vi
Function Palette > Mathematics > Probability & Statistics > Mean
Array Min Max
Function Palette > Array

You might also like