Skip to content Skip to navigation

Connexions

You are here: Home » Content » Temperature Monitor VI

Navigation

Content Actions

  • Download module PDF
  • Add to ...
    Add the module to:
    • My Favorites
    • A lens
    • An external social bookmarking service
    • My Favorites (What is 'My Favorites'?)
      'My Favorites' is a special kind of lens which you can use to bookmark modules and collections directly in Connexions. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need a Connexions account to use 'My Favorites'.
    • A lens (What is a lens?)

      Definition of 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.

      What are tags? tag icon

      Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

    • External bookmarks
  • E-mail the author
  • Rate this module (How does the rating system work?)

    Rating system

    Ratings

    Ratings allow you to judge the quality of modules. If other users have ranked the module then its average rating is displayed below. Ratings are calculated on a scale from one star (Poor) to five stars (Excellent).

    How to rate a module

    Hover over the star that corresponds to the rating you wish to assign. Click on the star to add your rating. Your rating should be based on the quality of the content. You must have an account and be logged in to rate content.

    (0 ratings)

Lenses

What is a lens?

Definition of 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.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

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.
  • National Instruments display tagshide tags

    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.

    Click the tag icon tag icon to display tags associated with this content.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

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.

Note: Your browser may not currently support MathML. See our browser support page for additional details. You can always view the correct math in the PDF version.

Exercise 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
    Figure 1 (tempmon.png)
    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. labeling.png 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
    Figure 2 (tempmonbd.png)
  3. Right-click the conditional terminal and select Continue if True.
  4. Wire the objects as shown in Figure 2.
    1. tempicon.png 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. waitms.png Place the Wait Until Next ms Multiple function, located on the Functions>>All Functions>>Time & Dialog palette, on the block diagram.
    3. tempmonconst.png 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
      Figure 3 (chartprop2.png)
    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
      Figure 4 (chartprop3.png)
    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
      Figure 5 (chartprop4.png)
    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. latchpress.png 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?

Send feedback