<?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>File Writer VI</name>
  <metadata>
  <md:version>**new**</md:version>
  <md:created>2004/06/22 09:25:16.883 GMT-5</md:created>
  <md:revised>2004/06/22 09:26:40.916 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="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="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>exercise</md:keyword>
    <md:keyword>VI</md:keyword>
  </md:keywordlist>

  <md:abstract>In this exercise, the objective is to write data to a file. Complete the following steps to build a VI that concatenates a message string, a numeric value, and a unit string to a file. In another exercise, you will build a VI that reads the file and displays its contents.
</md:abstract>
</metadata>
  <!--When CNXML 0.6 comes out, this module will need to be revised to
  include para in the items indicated-->
  <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="filewriter.png"/>
	      </figure>
	      <list id="s1l1l1" type="enumerated">
		<item>
		  Place a path indicator located on the
		  <code>Controls&gt;&gt;Text Indicators</code> palette on
		  the front panel. This indicator displays the path
		  for the data file you create.
		</item>
		<item>
		  Right-click the <code>String to Write</code> control
		  and select <code>Visible Items&gt;&gt;Scrollbar</code>
		  from the shortcut menu to display a scrollbar.
		</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="filewriterbd.png"/>
	      </figure>
	      <list id="s2l1l1" type="enumerated">
		<item>
		    <media type="image/png" src="buildstringicon.png"/>
		  Place the <code>Create String
		  VI</code> from the <cnxn document="mex81">previous
		  exercise</cnxn> on the block diagram. Select
		  <code>Functions&gt;&gt;All Functions&gt;&gt;Select a VI</code>
		  and navigate to <code>C:\Exercises\LabVIEW Basics
		  I\Create String.vi</code>. This subVI concatenates
		  the three input strings to one combined string.
		</item>
		<item>
		  <!--needs para--> 
		  <media type="image/png" src="OpenFileIcon.png"/>
		  <!--para--> 
		  Place the <code>Open/Create/Replace File</code> VI,
		  located on the <code>Functions&gt;&gt;All Functions&gt;&gt;File
		  I/O</code> palette, on the block diagram. This VI
		  displays a dialog box to open or create a file.
		  <!--para--> Right-click the <code>prompt</code>
		  input, select <code>Create&gt;&gt;Constant</code> from the
		  shortcut menu, and type <code>Enter Filename</code>
		  in the constant. When the VI runs, a file navigation
		  dialog box appears with <code>Enter Filename</code>
		  as the title of the window.  
		  <!--para--> 
		  Right-click the <code>function</code> input, select
		  <code>Create&gt;&gt;Constant</code> from the shortcut
		  menu, and click the constant with the
		  <code>Operating</code> tool to select <code>create
		  or replace</code>.
		</item>
		<item>
		    <media type="image/png" src="WriteFileIcon.png"/>
		  Place the <code>Write File</code>
		  function, located on the <code>Functions&gt;&gt;All
		  Functions&gt;&gt;File I/O</code> palette, on the block
		  diagram. This function writes the concatenated
		  strings to the file.
		</item>
		<item>
		    <media type="image/png" src="CloseFileIcon.png"/>
		  Place the <code>Close File</code>
		  function, located on the <code>Functions&gt;&gt;All
		  Functions&gt;&gt;File I/O</code> palette, on the block
		  diagram. This function closes the file.
		</item>
		<item>
		    <media type="image/png" 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
		  function checks the error cluster and displays a
		  dialog box if an error occurs.
		</item>
		<item>
		  Complete the block diagram as shown in <cnxn target="s2l1f1"/>.
		</item>
	      </list>
	    </item>
	    <item>
	      Save the VI as <code>File Writer.vi</code> in the
	      <code>C:\Exercises\LabVIEW Basics I</code> directory.
	    </item>
	  </list>
	</section>
	<section id="s3">
	  <name>Run the VI</name>
	  <list id="s3l1" type="enumerated">
	    <item>
	      Enter values in the front panel controls and run the
	      VI. An <code>Enter Filename</code> dialog box appears.
	    </item>
	    <item><!--needs para-->
	      <!--para-->
	      Type <code>demofile.txt</code> and click the
	      <code>Save</code> or <code>OK</code> button to save the
	      file.
	      <!--para-->
	      The VI writes the <code>String to Write</code>,
	      <code>Numeric to Write</code>, and <code>Unit to
	      Write</code> values to the file.
	    </item>
	    <item>
	      Close the VI.
	    </item>
	  </list>
	</section>
      </problem>
    </exercise>
	      

  </content>
  
</document>
