<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_mathml.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="None">
  <name>Voltmeter VI </name>
  <metadata>
  <md:version>1.1</md:version>
  <md:created>2004/06/17 15:19:41 GMT-5</md:created>
  <md:revised>2004/07/16 15:30:42.767 GMT-5</md:revised>
  <md:authorlist>
      <md:author id="NationalInstruments">
      <md:firstname>National</md:firstname>
      
      <md:surname>Instruments</md:surname>
      <md:email>certification@ni.com</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="lizzardg">
      <md:firstname>Elizabeth</md:firstname>
      
      <md:surname>Gregory</md:surname>
      <md:email>lizzardg@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="mshiralkar05">
      <md:firstname>Malan</md:firstname>
      
      <md:surname>Shiralkar</md:surname>
      <md:email>mshiralkar05@hotmail.com</md:email>
    </md:maintainer>
    <md:maintainer id="harika">
      <md:firstname>Harika</md:firstname>
      
      <md:surname>Basana</md:surname>
      <md:email>ilsai@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="NationalInstruments">
      <md:firstname>National</md:firstname>
      
      <md:surname>Instruments</md:surname>
      <md:email>certification@ni.com</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>National Instruments</md:keyword>
    <md:keyword>LabVIEW</md:keyword>
    <md:keyword>Voltmeter</md:keyword>
    <md:keyword>exercise</md:keyword>
    <md:keyword>VI</md:keyword>
  </md:keywordlist>

  <md:abstract>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.
</md:abstract>
</metadata>

  <content>
    <exercise id="e1">
      <problem>
	<section id="s1">
	  <name>Front Panel</name>
	  <list id="s1l1" type="enumerated">
	    <item>
	      Open a blank VI and build the front panel shown in <cnxn target="s1l1f1"/>.
	      <figure id="s1l1f1">
		<media type="image/png" src="voltmeterfp.png"/>
	      </figure>
	      <list id="s1l1l1" type="enumerated">
		<item>
		  Place the <code>Meter</code>, located on the
		  <code>Controls&gt;&gt;Numeric Indicators</code> palette,
		  on the front panel. Configure the meter scale for
		  <code>0.0</code> to <code>0.4</code>. Use the <code>Labeling</code> tool to double-click
		  <code>10.0</code> and type <code>0.4</code>. You might need to enlarge the
		  meter to display the scale as shown in the <cnxn target="s1l1f1">example</cnxn>.
		</item>
		<item>
		  Place a <code>Vertical Toggle Switch</code>, located
		  on the <code>Controls&gt;&gt;Buttons &amp; Switches</code>
		  palette, on the front panel. Configure the toggle
		  switch to a default value of <code>False</code> and
		  a mechanical action of <code>Latch When
		  Pressed</code>.
		</item>
		<item>
		  Create two free labels, <code>Off</code> and
		  <code>On</code>, using the <code>Labeling</code>
		  tool.
		</item>
	      </list>
	    </item>
	  </list>
	</section>
	<section id="s2">
	  <name>Block Diagram</name>
	  <list id="s2l1" type="enumerated">
	    <item>
	      Build the block diagram shown in <cnxn target="s2l1f1"/>.
	      <figure id="s2l1f1">
		<media type="image/png" src="voltmeterbd.png"/>
	      </figure>
	      <list id="s2l1l1" type="enumerated">
		<item>
		    <media type="image/png" src="DAQAssistantIcon.png"/>
		  Place the <code>DAQ Assistant</code> Express
		  VI located on the <code>Functions&gt;&gt;Input
		  palette</code>, on the block diagram. Configure this
		  VI to read an analog input channel and return the
		  voltage.
		  <list id="s2l1l1l1">
		    <item>
		      Select <code>Analog Input&gt;&gt;Voltage</code> for
		      the measurement to make.
		    </item>
		    <item>
		      Select <code>Dev1&gt;&gt;ai0</code> for the physical
		      channel.
		    </item>
		    <item>
		      Click the <code>Finish</code> button.
		    </item>
		    <item>
		      The <code>Analog Input Voltage Task</code>
		      dialog box appears. Configure the <code>Task
		      Timing</code> to <code>Acquire 1 Sample</code>.
		    </item>
		    <item>
		      Click the <code>OK</code> button to close the
		      <code>Analog Input Voltage Task
		      Configuration</code> dialog box. This saves the
		      settings specified for the task in the <code>DAQ
		      Assistant Express</code> VI.
		    </item>
		  </list>
		</item>
		<item>
		    <media type="image/png" src="waitms.png"/>
		  Place the <code>Wait Until Next ms
		  Multiple</code> function, located on the
		  <code>Functions&gt;&gt;All Functions&gt;&gt;Time &amp;
		  Dialog</code> palette, on the block
		  diagram. Right-click the input and select
		  <code>Create Constant</code> from the shortcut
		  menu. Type <code>100</code> in the constant to cause
		  the loop to execute every 100 ms.
		</item>
		<item>
		    <media type="image/png" src="unbundle.png"/>
		  Place the <code>Unbundle by
		  Name</code> function, located on the
		  <code>Functions&gt;&gt;All Functions&gt;&gt;Cluster</code>
		  palette, on the block diagram. Use this function to
		  access the <code>status</code> from the error
		  cluster.
		</item>
		<item>
		    <media type="image/png" src="or.png"/>
		  Place the <code>Or</code>
		  function, located on the <code>Functions&gt;&gt;Arithmetic
		  &amp; Comparison&gt;&gt;Express Boolean</code> 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.
		</item>
	      </list>
	    </item>
	    <item>
	      Save the VI as <code>Voltmeter.vi</code> in the
	      <code>C:\Exercises\LabVIEW Basics I</code>
	      directory. You will use this VI later in the course.
	    </item>
	    <item><!--needs para-->
	      <!--para-->
	      Display the front panel and run the VI.
	      <!--para-->
	      The meter displays the voltage the temperature sensor
	      outputs. Place your finger on the temperature sensor and
	      notice that the voltage increases.
	    </item>
	  </list>
	</section>
	<section id="s3">
	  <name>Scales</name>
	  <para id="s3p1">
	    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 <code>DAQ Assistant</code> Express VI by 100, or
	    configure the <code>DAQ Assistant</code> Express VI to automatically
	    scale the voltage. Using the capabilities that exist
	    within the VI reduces block diagram clutter.
	  </para>
	  <list id="s3l1" type="enumerated">
	    <item>
	      Double-click the <code>DAQ Assistant</code> to display
	      the <code>Analog Input Voltage Task Configuration</code>
	      dialog box.
	    </item>
	    <item>
	      Select <code>Create New</code> in the <code>Custom
	      Scaling</code> pull-down menu.
	    </item>
	    <item>
	      Select <code>Linear</code> and name the scale
	      <code>temperature</code>. Click the <code>Finish</code>
	      button.
	    </item>
	    <item>
	      A dialog box appears where you can scale the data by a
	      multiplier and an offset.
	      <list id="s3l1l1" type="enumerated">
		<item>
		  Set the <code>slope</code> to <code>100</code> and the <code>Scaled
		  Units</code> to <code>Celsius</code>.
		</item>
		<item>
		  Click the <code>OK</code> button to close the dialog
		  box.
		</item>
	      </list>
	    </item>
	    <item>
	      In the <code>Analog Input Voltage Task
	      Configuration</code> dialog box, set the <code>minimum input
	      range</code> to <code>0</code>, set the <code>maximum input range</code> to
	      <code>100</code>, and click the <code>OK</code> button
	      to return to the block diagram.
	    </item>
	    <item>
	      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.
	    </item>
	    <item>
	      Stop the VI. Save the VI but do not close it. You will
	      use the VI in the <cnxn document="m12271">Measurement
	      Averaging VI</cnxn> exercise.
	    </item>
	  </list>
	</section>
      </problem>
    </exercise>
		  
		      
  </content>
  
</document>
