<?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>Programming with VISA</name>
  <metadata>
  <md:version>**new**</md:version>
  <md:created>2004/06/16 13:01:20.091 GMT-5</md:created>
  <md:revised>2004/06/16 13:02:21.489 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>VISA</md:keyword>
    <md:keyword>exercise</md:keyword>
  </md:keywordlist>

  <md:abstract>In this exercise, the objective is to build a VI that reads and writes information from the NI Instrument Simulator using VISA functions. Complete the following steps to build a VI that uses VISA calls to acquire data from the NI Instrument Simulator.
</md:abstract>
</metadata>

  <content>
    <list id="l1" type="enumerated">
      <item>
	Make sure the Instrument Simulator is powered on and connected
	to the GPIB Interface.
      </item>
    </list>
    <section id="s1">
      <name>Front Panel</name>
      <list id="s1l1" type="enumerated">
	<item>
	  Open a blank VI. The front panel shown in <cnxn target="s1l1f1"/> will result from building the block
	  diagram.
	  <figure id="s1l1f1">
	    <media type="image/jpg" src="visafp.png"/>
	  </figure>
	</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="myvisabd.png"/>
	  </figure>
	  <list id="s2l1l1" type="enumerated">
	    <item>
		<media type="image/jpg" src="visaopen.png"/>
	      Place the <code>VISA Open</code>
	      function, located on the <code>Functions&gt;&gt;All
	      Functions&gt;&gt;Instrument I/O&gt;&gt;VISA&gt;&gt;VISA Advanced</code>
	      palette, on the block diagram. This function opens a
	      VISA session with an instrument. Right-click the
	      <code>VISA resource</code> name input and select
	      <code>Create&gt;&gt;Control</code> from the shortcut menu.
	    </item>
	    <item>
		<media type="image/jpg" src="visawriticon.png"/>
	      Place the <code>VISA Write</code>
	      function, located on the
	      <code>Functions&gt;&gt;All Functions&gt;&gt;Instrument
	      I/O&gt;&gt;VISA</code> palette, on the block
	      diagram. This function writes a string to the
	      instrument. Right-click the write buffer input and
	      select <code>Create&gt;&gt;Control</code> from the
	      shortcut menu.
	    </item>
	    <item>
		<media type="image/jpg" src="visareadicon.png"/>
	      Place the <code>VISA Read</code>
	      function, located on the
	      <code>Functions&gt;&gt;All Functions&gt;&gt;Instrument
	      I/O&gt;&gt;VISA</code> palette, on the block
	      diagram. This function reads data from the
	      instrument. Right-click the byte count input and select
	      <code>Create&gt;&gt;Control</code> from the shortcut
	      menu. Right-click the read buffer output and select
	      <code>Create&gt;&gt;Indicator</code> from the shortcut
	      menu.
	    </item>
	    <item>
		<media type="image/jpg" src="visaclose.png"/>
	      Place the <code>VISA Close</code>
	      function, located on the
	      <code>Functions&gt;&gt;All Functions&gt;&gt;Instrument
	      I/O&gt;&gt;VISA&gt;&gt;VISA Advanced</code> palette, on
	      the block diagram. This function closes the session with
	      the instrument and releases any system resources that
	      were used.
	    </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 checks error conditions and
	      opens a dialog box with error information if an error
	      occurs.
	    </item>
	  </list>
	</item>
	<item>
	  Save the VI as <code>My VISA Write &amp; Read.vi</code> in the
	  <code>C:\Exercises\LabVIEW Basics I</code> directory.
	</item>
	<item>
	  Display the front panel. Enter <code>devsim</code> in the
	  <code>VISA resource name</code> input and set <code>byte
	  count</code> to 200 to make sure you read all the
	  information. Type <code>*IDN?</code> in the <code>write
	  buffer</code> and run the VI.
	</item>
	<item>
	  The top of the instrument simulator lists other commands
	  that are recognized by this instrument. Try other commands
	  in this VI.
	</item>
	<item>
	  Close the VI when finished.
	</item>
      </list>
    </section>

  </content> 
</document>
