Connexions

You are here: Home » Content » Voltmeter 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.

Voltmeter VI

Module by: National Instruments

Summary: In this exercise, the objective is to acquire an analog signal using a DAQ device. Complete the following steps to build a VI that measures the voltage that the temperature sensor on the DAQ Signal Accessory outputs. The temperature sensor outputs a voltage proportional to the temperature. The sensor is hard-wired to channel 0 of the DAQ device.

Problem 1

1.a) Front Panel

  1. Open a blank VI and build the front panel shown in Figure 1.
    Figure 1
    1. Place the Meter, located on the Controls>>Numeric Indicators palette, on the front panel. Configure the meter scale for 0.0 to 0.4. Use the Labeling tool to double-click 10.0 and type 0.4. You might need to enlarge the meter to display the scale as shown in the example.
    2. Place a Vertical Toggle Switch, located on the Controls>>Buttons & Switches palette, on the front panel. Configure the toggle switch to a default value of False and a mechanical action of Latch When Pressed.
    3. Create two free labels, Off and On, using the Labeling tool.

1.b) Block Diagram

  1. Build the block diagram shown in Figure 2.
    Figure 2
    1. Place the DAQ Assistant Express VI located on the Functions>>Input palette, on the block diagram. Configure this VI to read an analog input channel and return the voltage.
      • Select Analog Input>>Voltage for the measurement to make.
      • Select Dev1>>ai0 for the physical channel.
      • Click the Finish button.
      • The Analog Input Voltage Task dialog box appears. Configure the Task Timing to Acquire 1 Sample.
      • Click the OK button to close the Analog Input Voltage Task Configuration dialog box. This saves the settings specified for the task in the DAQ Assistant Express VI.
    2. Place the Wait Until Next ms Multiple function, located on the Functions>>All Functions>>Time & Dialog palette, on the block diagram. Right-click the input and select Create Constant from the shortcut menu. Type 100 in the constant to cause the loop to execute every 100 ms.
    3. Place the Unbundle by Name function, located on the Functions>>All Functions>>Cluster palette, on the block diagram. Use this function to access the status from the error cluster.
    4. Place the Or function, located on the Functions>>Arithmetic & Comparison>>Express Boolean palette, on the block diagram. This function stops the loop if an error occurs or the user clicks the power switch on the front panel.
  2. Save the VI as Voltmeter.vi in the C:\Exercises\LabVIEW Basics I directory. You will use this VI later in the course.
  3. Display the front panel and run the VI. The meter displays the voltage the temperature sensor outputs. Place your finger on the temperature sensor and notice that the voltage increases.

1.c) Scales

The temperature sensor on the DAQ Signal Accessory outputs the voltage in degrees Celsius, scaled by 100. In order to convert the voltage into degrees Celsius, it is necessary to multiply the voltage by 100. You could multiply the output of the DAQ Assistant Express VI by 100, or configure the DAQ Assistant Express VI to automatically scale the voltage. Using the capabilities that exist within the VI reduces block diagram clutter.
  1. Double-click the DAQ Assistant to display the Analog Input Voltage Task Configuration dialog box.
  2. Select Create New in the Custom Scaling pull-down menu.
  3. Select Linear and name the scale temperature. Click the Finish button.
  4. A dialog box appears where you can scale the data by a multiplier and an offset.
    1. Set the slope to 100 and the Scaled Units to Celsius.
    2. Click the OK button to close the dialog box.
  5. In the Analog Input Voltage Task Configuration dialog box, set the minimum input range to 0, set the maximum input range to 100, and click the OK button to return to the block diagram.
  6. Run the VI. The temperature displays in the meter. The temperature values are 100 times greater than the voltage values. Change the meter scale to see the correct values.
  7. Stop the VI. Save the VI but do not close it. You will use the VI in the Measurement Averaging VI exercise.

Comments, questions, feedback, criticisms?

Discussion forum

Send feedback