Connexions

You are here: Home » Content » Temperature Monitor VI
Content Actions
Lenses

What is a lens?

Lenses

A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual Connexions member, a community, or a respected organization.

This content is ...
Affiliated with (?)
This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • This module is included in aLens by: National InstrumentsAs a part of collection:"LabVIEW Graphical Programming Course"

    Comments:

    "A full introductory course on programming with LabVIEW."

    Click the "National Instruments" link to see all content affiliated with them.

    National Instruments
Also in these lenses
  • This module is included inLens: Connexions Books Available for Print on Demand
    By: ConnexionsAs a part of collection:"LabVIEW Graphical Programming Course"

    Comments:

    "This book is available through the Connexions beta version of print-on-demand from online materials."

    Click the "Printable Books" link to see all content selected in this lens.

    Printable Books
Tags

(?)

These tags come from the endorsement, affiliation, and other lenses that include this content.

Temperature Monitor VI

Module by: National Instruments

Summary: Use a While Loop and a waveform chart to acquire and display data.

Problem 1
Complete the following steps to build a VI that measures temperature and displays it on a waveform chart.

1.a) Front Panel

  1. Open a blank VI and build the front panel shown in Figure 1.
    Figure 1
    1. Place the vertical toggle switch, located on the Controls>>Buttons & Switches palette, on the front panel. Label this switch Power. You use the switch to stop the acquisition.
    2. Place a waveform chart, located on the Controls>>Graph Indicators palette, on the front panel. Label the chart Temperature History. The waveform chart displays the temperature in real time.
    3. The waveform chart legend labels the plot Plot 0. Use the Labeling tool to triple-click Plot 0 in the chart legend, and change the label to Temp.
    4. The temperature sensor measures room temperature. Use the Labeling tool to double-click 10.0 10.0 in the y-axis and type 90 90 to rescale the chart. Leave the x-axis in its default state.
    5. Change -10.0 10.0 in the y-axis to 70 70.
    6. Label the y-axis Temp (Deg F) and the x-axis Time (sec).

1.b) Block Diagram

  1. Select Window>>Show Block Diagram to display the block diagram.
  2. Enclose the two terminals in a While Loop, as shown in the block diagram.
    Figure 2
  3. Right-click the conditional terminal and select Continue if True.
  4. Wire the objects as shown in Figure 2.
    1. Place the Thermometer VI on the block diagram. Select Functions>>All Functions>>Select a VI and navigate to C:\Exercises\LabVIEW Basics I\Thermometer.vi. This subVI returns one temperature measurement from the temperature sensor.
      note: Use the (Demo) Thermometer VI if you do not have a DAQ device available.
    2. Place the Wait Until Next ms Multiple function, located on the Functions>>All Functions>>Time & Dialog palette, on the block diagram.
    3. Right-click the millisecond multiple input of the Wait Until Next ms Multiple function, select Create>>Constant from the shortcut menu, type 500 500, and press the <Enter> key. The numeric constant specifies a wait of 500ms 500 ms so the loop executes once every half-second.
      note: To measure temperature in Celsius, wire a Boolean True constant located on the Functions>>Arithmetic & Comparison>>Express Boolean palette to the Temp Scale input of the Thermometer VI. Change the scales on charts and graphs in subsequent exercises to a range of 20 20 to 32 32 instead of 70 70 to 90 90.
  5. Save the VI as Temperature Monitor.vi in the C:\Exercises\LabVIEW Basics I directory.

1.c) Run the VI

  1. Display the front panel by clicking it or by selecting Window>>Show Front Panel.
  2. Use the Operating tool to click the vertical toggle switch and turn it to the ON position.
  3. Run the VI. The subdiagram within the While Loop border executes until the specified condition is True. For example, while the switch is on (True), the Thermometer VI takes and returns a new measurement and displays it on the waveform chart.
  4. Click the vertical toggle switch to stop the acquisition. The condition is False, and the loop stops executing.

1.d) Front Panel

  1. Format and customize the x- and y-scales of the waveform chart.
    1. Right-click the chart and select Properties from the shortcut menu to display the Chart Properties dialog box.
    2. Click the Format and Precision tab. Select Deg F (Y-axis) in the top pull-down menu. Set the Digits of precision to 11.
    3. Click the Plots tab and select different styles for the y-axis, as shown in Figure 3.
      Figure 3
    4. Select the Scales tab and select the Time (sec) (X-axis) in the top pull-down menu. Set the scale options as shown in Figure 4. Set the Multiplier to 0.50 0.50 to account for the 500 ms Wait function.
      Figure 4
    5. In the Scales tab, select the Deg F (Y-axis) in the top pull-down menu. Set the scale options as shown in Figure 5.
      Figure 5
    6. Click the OK button to close the dialog box when finished.
  2. Right-click the waveform chart and select Data Operations>>Clear Chart from the shortcut menu to clear the display buffer and reset the waveform chart.
    tip: When a VI is running, you can select Clear Chart from the shortcut menu.
  3. Each time you run the VI, you first must turn on the vertical toggle switch and then click the Run button due to the current mechanical action of the switch. Modify the mechanical action of the vertical toggle switch so temperature is plotted on the graph each time you run the VI, without having to first set the toggle switch.
    1. Stop the VI if it is running.
    2. Use the Operating tool to click the vertical toggle switch and turn it to the ON position.
    3. Right-click the switch and select Data Operations>>Make Current Value Default from the shortcut menu. This sets the ON position as the default value.
    4. Right-click the switch and select Mechanical Action>>Latch When Pressed from the shortcut menu. This setting changes the control value when you click it and retains the new value until the VI reads it once. At this point the control reverts to its default value, even if you keep pressing the mouse button. This action is similar to a circuit breaker and is useful for stopping While Loops or for getting the VI to perform an action only once each time you set the control.

1.e) Run the VI

  1. Run the VI.
  2. Use the Operating tool to click the vertical switch to stop the acquisition. The switch changes to the OFF position and changes back to ON after the conditional terminal reads the value.
  3. Save the VI. You will use this VI in the Temperature Running Average VI.

Comments, questions, feedback, criticisms?

Discussion forum

Send feedback