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

LabVIEWBasics I-Exercise3 1

programas labview de programación avanzada

Uploaded by

Ariadna Landa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views

LabVIEWBasics I-Exercise3 1

programas labview de programación avanzada

Uploaded by

Ariadna Landa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Lesson 3 Implementing a VI

Exercise 3-1 Project: Weather Station UI VI


Goal
Create a front panel based on a given specification.

Scenario
You are given the design information for a weather station project that you
must implement. Using the information, create a front panel that will be the
user interface for the Weather Station VI.

Design

User Interface Inputs and Outputs

Type Name Properties


Numeric Control Upper Limit Double-Precision
Numeric Control Lower Limit Double-Precision
Waveform Chart Temperature Digital Display visible
History
String Indicator Warning Three possible values:
Heatstroke Warning, No
Warning, and Freeze Warning
Boolean Control Stop

External Inputs and Outputs


• Current temperature—retrieved from a sensor attached to AI0 of the
data acquisition board. Conversion formula: Voltage x 100 = degrees
Celsius
• ASCII File—time, current temperature, temperature limits and warning
string for each warning that occurred; tab-delimited.

© National Instruments Corporation 3-9 LabVIEW Introduction Course Manual


Lesson 3 Implementing a VI

State Transition Diagram


You developed a state transition diagram for the weather station in
Exercise 1-2. However, to ensure consistency with the instructions given in
this manual, a state transition diagram is shown in Figure 3-3 for you to use
on the course project from this exercise forward.

Initialize

Acquisition

Time Elapsed=TRUE
and
Stop=False

Warning=TRUE
Analysis

Datalog

Time Elapsed=FALSE
and
Stop=FALSE
Time Check

Warning=FALSE

Stop=TRUE

Figure 3-3. State Transition Diagram for the Course Project

LabVIEW Introduction Course Manual 3-10 ni.com


Lesson 3 Implementing a VI

Implementation
Each input entered and each output displayed must appear on the front
panel. Complete the following instructions to create a front panel similar to
that shown in Figure 3-4. This front panel retrieves the upper and lower
temperature limits and a stop Boolean and displays the warning string and
the temperature history.

Figure 3-4. Front Panel for the Temperature Weather Station Project

1. Select File»New Project to create a new project in LabVIEW to contain


the VIs associated with the temperature weather station.

2. Create a new VI for the user interface of the project.

❑ Select File»New VI.

❑ Save the VI as Weather Station UI.vi in the


C:\Exercises\LabVIEW_Basics_I\Course Project
directory.

3. Save the project.

❑ Select File»Save Project.

❑ Save the project as Weather Station.lvproj in the


C:\Exercises\LabVIEW_Basics_I\Course Project
directory.

4. Create a numeric control for the upper temperature limit.

❑ Place a numeric control on the front panel.

© National Instruments Corporation 3-11 LabVIEW Introduction Course Manual


Lesson 3 Implementing a VI

❑ Change the label text of the numeric control to Upper Limit.

❑ Right-click the control, select Representation, and confirm that the


representation type is set to double precision.
5. Create a numeric control for the lower temperature limit.

❑ Place a numeric control on the front panel.

❑ Change the label of the numeric control to Lower Limit.

❑ Right-click the control, select Representation, and confirm that the


representation type is set to double precision.

6. Create a waveform chart for displaying the current temperature.

❑ Place a waveform chart on the front panel.

❑ Change the label text to Temperature History.

❑ Right-click the waveform chart and select Visible Items»Digital


Display. This display shows the numeric value of the last item
charted.

Note You modify the behavior and appearance of the waveform chart in another
exercise.

7. Create a string indicator for displaying the current warning state.

❑ Place a string indicator on the front panel.

❑ Change the label text to Warning.

❑ Place the mouse cursor inside the indicator area.

❑ Use the font tools on the front panel toolbar to change the size, color
and font of the indicator.

Tip You can enter text into the Warning indicator to test the fonts that you choose.

8. Create a Stop button.

❑ Place a Stop button on the front panel.

❑ Right-click the Stop button and select Visible Items»Label, to hide


the label.

LabVIEW Introduction Course Manual 3-12 ni.com


Lesson 3 Implementing a VI

❑ Increase the size of the Stop button by selecting a corner of the Stop
button with the selection tool and dragging the area to the desired
size and shape.

9. Add labels and decorations and arrange the objects on the front panel to
increase the usability. Refer to Figure 3-4 for suggestions, or design the
front panel your own way. Tips:

❑ Temperature Ranges (C) is a free label. You can create a free


label by double-clicking in an empty area of the front panel and
typing the text.

❑ The square around the temperature ranges and the triangles used to
illustrate heatstroke and freeze is available in the Decorations
category of the Controls palette.

❑ Visually group all controls together on the left side of the front
panel.

❑ Visually group all indicators together on the right side of the panel.
The Stop button is the only exception to this rule, as it is generally
placed in the lower right side of the panel.

❑ Visually group similar objects together.

❑ Use colors where appropriate on the front panel. For example, the
Stop button is usually red, heat is generally associated with red, and
cold is generally associated with blue.

10. Save the VI.

11. Close the project.

You continue to build this project in later exercises.

End of Exercise 3-1

© National Instruments Corporation 3-13 LabVIEW Introduction Course Manual

You might also like