<?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>Voltage Monitor VI</name>
  <metadata>
  <md:version>**new**</md:version>
  <md:created>2004/06/16 13:41:43.690 GMT-5</md:created>
  <md:revised>2004/06/16 13:42:43.131 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="harika">
      <md:firstname>Harika</md:firstname>
      
      <md:surname>Basana</md:surname>
      <md:email>ilsai@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="lizzardg">
      <md:firstname>Elizabeth</md:firstname>
      
      <md:surname>Gregory</md:surname>
      <md:email>lizzardg@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>VI</md:keyword>
    <md:keyword>exercise</md:keyword>
  </md:keywordlist>

  <md:abstract>In this exercise, the objective is to build a VI that uses the DevSim instrument driver VIs to acquire and plot voltages. Complete the following steps to build a VI that acquires a DC voltage measurement from the NI Instrument Simulator once every second and plots it in a waveform chart until you click a button. As each value is acquired, the VI compares it with the previous minimum and maximum values. The VI calculates and displays the minimum and maximum values continuously on the front panel.
</md:abstract>
</metadata>

  <content>
    <section id="s1">
      <name>Front Panel</name>
      <list id="s1l1" type="enumerated">
	<item>
	  Select <code>File&gt;&gt;New</code>, then select
	  <code>Template&gt;&gt;Frameworks&gt;&gt;Single Loop Application</code>
	  to open the <code>Single Loop Application template</code>
	  VI.
	</item>
	<item>
	  Build the front panel shown in <cnxn target="s1l1f1"/>.
	  <figure id="s1l1f1">
	    <media type="image/jpg" src="voltmonfp.png"/>
	  </figure>
	  Use the following guidelines to help you construct the front
	  panel.
	  <list id="s1l1l1">
	    <item>
	      Place a VISA resource name control, located on the
	      <code>Controls&gt;&gt;All Controls&gt;&gt;I/O</code> palette, on the
	      front panel.
	    </item>
	    <item>
	      Set the x-axis scale of the waveform chart to show
	      incremental values.
	    </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/jpg" src="voltmonbd.png"/>
	  </figure>
	  <list id="s2l1l1" type="enumerated">
	    <item>
	      Create two shift registers by right-clicking the right
	      or left border of the loop and selecting <code>Add Shift
	      Register</code> from the shortcut menu.
	    </item>
	    <item>
		<media type="image/jpg" src="dvsiminiticon.png"/>
	      Place the <code>NI DEVSIM Initialize</code>
	      VI, located on the
	      <code>Functions&gt;&gt;Input&gt;&gt;Instrument Drivers&gt;&gt;NI Device
	      Simulator</code> palette, on the block diagram. This VI
	      opens communication between LabVIEW and the NI
	      Instrument Simulator.
	      <list id="s2l1l1l1">
		<item>
		  Right-click the <code>ID Query</code> input and
		  select <code>Create&gt;&gt;Constant</code> from the
		  shortcut menu. Use the <code>Operating</code> tool
		  to change the constant to a <code>False</code>
		  value.
		</item>
		<item>
		  Wire the Boolean constant to the <code>Reset</code>
		  input.
		</item>
	      </list>
	    </item>
	    <item>
		<media type="image/jpg" src="dvsimetericon.png"/>
	      Place the <code>NI DEVSIM Multimeter
	      Configuration</code> VI, located on the
	      <code>Functions&gt;&gt;Input&gt;&gt;Instrument Drivers&gt;&gt;NI Device
	      Simulator&gt;&gt;Configuration</code> palette, on the block
	      diagram. This VI configures the range of voltage
	      measurements that the NI Instrument Simulator
	      generates. The default is 0.0 to 10.0 V DC.
	    </item>
	    <item>
		<media type="image/jpg" src="dvsimeasicon.png"/>
	      Place the <code>NI DEVSIM Measure DC
	      Voltage</code> VI, located on the
	      <code>Functions&gt;&gt;Input&gt;&gt;Instrument Drivers&gt;&gt;NI Device
	      Simulator&gt;&gt;Data</code> palette, on the block
	      diagram. This VI returns a simulated voltage measurement
	      from the NI Instrument Simulator.
	    </item>
	    <item><media type="image/jpg" src="dvsimclsicon.png"/>
	      Place the <code>NI DEVSIM Close</code>
	      VI, located on the
	      <code>Functions&gt;&gt;Input&gt;&gt;Instrument Drivers&gt;&gt;NI Device
	      Simulator</code> palette, on the block diagram. This VI
	      ends communication between LabVIEW and the NI Instrument
	      Simulator.
	    </item>
	    <item>
		<media type="image/jpg" src="maxminicon.png"/>
	      Place the <code>Max &amp; Min</code>
	      function, located on the <code>Functions&gt;&gt;All
	      Functions&gt;&gt;Comparison</code> palette, on the block
	      diagram. Use two of these functions to check the current
	      voltage against the minimum and maximum values stored in
	      the shift registers.
	    </item>
	    <item>
		<media type="image/jpg" src="Error.png"/>
	      Place the <code>Simple Error Handler</code>
              VI, located on the <code>Functions&gt;&gt;All
              Functions&gt;&gt;Time &amp; Dialog</code> palette, on the block
              diagram. This VI displays a dialog box if an error
              occurs and displays the error information.
	    </item>
	    <item>
		<media type="image/jpg" 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. This function accepts status from the error
	      cluster.
	    </item>
	    <item>
		<media type="image/jpg" 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 controls when the <code>While Loop</code>
	      ends. If there is an error or you click the
	      <code>Stop</code> button, the <code>While Loop</code> stops.
	    </item>
	    <item>
		<media type="image/jpg" src="EXtimedelay.png"/>
	      Set the wait for the <code>Time Delay</code>
	      Express VI to 1 second.
	    </item>
	    <item>
	      Wire the block diagram as shown in <cnxn target="s2l1f1"/>.
	      <note>
		You do not need to wire every terminal for each
		node. Wire only the necessary inputs for each node,
		such as instrument descriptor, VISA session, and error
		I/O.
	      </note>
	    </item>
	  </list>
	</item>
	<item>
	  Save the VI as <code>Voltage Monitor.vi</code> in the
	  <code>C:\Exercises\LabVIEW Basics I</code> directory.
	</item>
	<item>
	  Make sure the NI Instrument Simulator is powered on.
	</item>
	<item>
	  Display the front panel and run the VI. The LEDs alternate
	  between Listen and Talk as LabVIEW communicates with the
	  GPIB instrument once a second to get a simulated voltage
	  reading. This voltage displays on the chart, and the minimum
	  and maximum values update accordingly.
	</item>
	<item>
	  Stop and close the VI. 
	</item>
      </list>
    </section>
	
  </content>
  
</document>
