<?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>Simple Data Logger VI</name>
  <metadata>
  <md:version>**new**</md:version>
  <md:created>2004/06/18 09:23:40.179 GMT-5</md:created>
  <md:revised>2004/06/18 09:25:01.577 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 VI</md:keyword>
  </md:keywordlist>

  <md:abstract>In this exercise, the objective is to learn to use a LabVIEW Measurement File. Complete the following steps to modify the Measurement Averaging VI to log the acquired data to a LabVIEW Measurement File. Create another VI that reads the data file.
</md:abstract>
</metadata>

  <content>
    <exercise id="e1">
      <problem>
	<section id="s1">
	  <name>Simple Data Logger Block Diagram</name>
	  <list id="s1l1" type="enumerated">
	    <item>
	      Open the <code>Measurement Averaging VI</code> located
	      in the <code>C:\Exercises\LabVIEW Basics I</code>
	      directory.
	    </item>
	    <item><!--needs para-->
	      <!--para-->
	      Modify the block diagram to log the acquired data as
	      shown in <cnxn target="s1l1f1"/>.
	      <figure id="s1l1f1">
		<media type="image/png" src="simpledataloggerbd.png"/>
	      </figure>
	      
		<media type="image/png" src="writelvm.png"/>
	      
	      <!--para-->
	      Place the <code>Write LabVIEW
	      Measurement File</code> Express VI, located on the
	      <code>Functions&gt;&gt;Output</code> palette, on the block
	      diagram. This Express VI stores the data acquired from
	      the DAQ device. In the <code>Configure Write LabVIEW
	      Measurement File</code> dialog box that appears, set the
	      following options:
	      <list id="s1l1l1" type="enumerated">
		<item>
		  Set the <code>Action</code> to <code>Ask user to
		  choose file</code> for the filename.
		</item>
		<item>
		  Set the <code>Segment Headers</code> to <code>One
		  header only</code> to provide a header for all of
		  the data. The header contains information about the
		  sampling rate and the time when the sample was
		  taken.
		</item>
		<item>
		  Set <code>X Value Columns</code> to <code>One column
		  per channel</code> to provide a table of data that
		  can be read by any spreadsheet editor or an ASCII
		  text file editor.
		</item>
		<item>
		  Set the <code>Delimiter</code> to <code>Tab</code>
		  to make it easy for a spreadsheet editor to
		  determine where a column of data starts in the file.
		</item>
		<item>
		  Click the <code>OK</code> button to close the dialog
		  box.
		</item>
	      </list>
		<media type="image/png" src="mergeerrorsicon.png"/>
	      <!--para-->
	      Place the <code>Merge Errors</code> VI,
	      located on the <code>Functions&gt;&gt;All Functions&gt;&gt;Time
	      &amp; Dialog</code> palette, on the block diagram. It is
	      important to catch errors with both DAQ and file I/O,
	      and because the code has a parallel structure it is
	      necessary to merge the errors from all of the parallel
	      operations to determine if the code is functioning
	      properly.
	    </item>
	    <item>
	      Select <code>File&gt;&gt;Save As</code> to save the VI as
	      <code>Simple Data Logger.vi</code> in the
	      <code>C:\Exercises\LabVIEW Basics I</code> directory.
	    </item>
	    <item id="step4">
	      Run the VI. A filename prompt appears. Name the file
	      <code>logger.lvm</code> in the
	      <code>C:\Exercises\LabVIEW Basics I</code> directory.
	    </item>
	    <item>
	      Stop and close the VI.
	    </item>
	  </list>
	</section>
	<section id="s2">
	  <name>Simple Data Reader Front Panel</name>
	  <list id="s2l1" type="enumerated">
	    <item>
	      Open a blank VI and build the front panel shown in <cnxn target="s2f1"/> by placing a waveform chart, located on
	      the <code>Controls&gt;&gt;Graph Indicators</code> palette, on
	      the front panel.
	    </item>
	  </list>
	  <figure id="s2f1">
	    <media type="image/png" src="simpledatareaderfp.png"/>
	  </figure>
	</section>
	<section id="s3">
	  <name>Block Diagram</name>
	  <list id="s3l1" type="enumerated">
	    <item>
	      Build the block diagram shown in <cnxn target="s3l1f1"/>.
	      <figure id="s3l1f1">
		<media type="image/png" src="simpledatareaderbd.png"/>
	      </figure>
	      <list id="s3l1l1" type="enumerated">
		<item>
		    <media type="image/png" src="readlvm.png"/>
		  Place the <code>Read LabVIEW
		  Measurement File</code> Express VI, located on the
		  <code>Functions&gt;&gt;Input</code> palette, on the block
		  diagram. Because this Express VI reads data located
		  in a LabVIEW measurement file one data point at a
		  time, it must be placed in a loop. In the
		  <code>Configure Read LabVIEW Measurement File</code>
		  dialog box that appears, set the following options:
		  <list id="s3l1l1l1">
		    <item>
		      In the <code>Action</code> section, place a
		      checkmark in the <code>Ask user to choose
		      file</code> checkbox.
		    </item>
		    <item>
		      Set the <code>Segment Size</code> to
		      <code>Retrieve segments of original size</code>
		      so that all the data stored in the file is
		      retrieved.
		    </item>
		    <item>
		      Set <code>Time Stamps</code> to <code>Relative
		      to start of measurement</code>. Because the
		      dynamic data type stores information about the
		      signal timing, this setting aligns the data with
		      the time of the measurement.
		    </item>
		    <item>
		      In the <code>Generic Text File</code> section,
		      remove the checkmark from the <code>Read generic
		      text files</code> checkbox because the data is
		      stored in a LabVIEW measurement file.
		    </item>
		    <item>
		      Click the <code>OK</code> button to close the
		      dialog box.
		    </item>
		  </list>
		</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.
		</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.
		</item>
		<item><!--para needed-->
		  <!--para-->
		  Wire the <code>EOF?</code> output of the <code>Read
		  LabVIEW Measurement File</code> function to the
		  <code>Or</code> function. Wire the
		  <code>status</code> output of the error cluster to
		  the second input of the <code>Or</code> function.
		  <!--para--> 
		  This stops the <code>While Loop</code> when the
		  entire <code>LabVIEW Measurement File</code> has
		  been read or when an error occurs.
		</item>
	      </list>
	    </item>
	    <item>
	      Save the VI as <code>Simple Data Reader.vi</code> in the
	      <code>C:\Exercises\LabVIEW Basics I</code> directory.
	    </item>
	    <item>
	      Display the front panel, and run the VI. In the filename
	      prompt that appears, select the <code>logger.lvm</code>
	      file that you created <cnxn target="step4">earlier</cnxn>.
	    </item>
	    <item>
	      The data that was stored in the LabVIEW Measurement File
	      appears in the waveform chart.
	      <note>
		You might need to rescale or autoscale the y-axis of
		the waveform chart to display the data.
	      </note>
	    </item>
	    <item>
	      Close the <code>Simple Data Reader</code> VI.
	    </item>
	  </list>
	</section>
      </problem>
    </exercise>
	    
	    
  </content>
  
</document>
