<?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>Analog Input</name>
  <metadata>
  <md:version>**new**</md:version>
  <md:created>2004/06/17 15:09:51.558 GMT-5</md:created>
  <md:revised>2004/06/17 15:12:26.861 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>analog input</md:keyword>
    <md:keyword>analog</md:keyword>
  </md:keywordlist>

  <md:abstract>In this lesson, you will learn how to perform analog input.</md:abstract>
</metadata>

  <content>
    <para id="p1">
      Use analog input to perform analog-to-digital (A/D) conversions.
    </para>
    <para id="p2">
      The available <cnxn target="f1">analog input measurement
      types</cnxn> for a task are voltage, temperature, strain,
      current, resistance, or frequency.
    </para>
    <figure id="f1">
      <media type="image/png" src="aitasks.png"/>
    </figure>
    <para id="p3">
      Each measurement type has its own characteristics, such as
      resistor values for current measurements or strain gauge
      parameters for strain measurements.
    </para>
    <section id="s1">
      <name>Task Timing</name>
      <para id="s1p1">
	When performing analog input, the task can be timed to <cnxn target="s1s1">Acquire
	1 Sample</cnxn>, <cnxn target="s1s2">Acquire n Samples</cnxn>, or
	<cnxn target="s1s3">Acquire Continuously</cnxn>.
      </para>
      <section id="s1s1">
	<name>Acquire 1 Sample</name>
	<para id="s1s1p1">
	  Acquiring a single sample is an on-demand operation. In
	  other words, NI-DAQmx acquires one value from an input
	  channel and immediately returns the value. This operation
	  does not require any buffering or hardware timing. For
	  example, if you periodically monitor the fluid level in a
	  tank, you would acquire single data points. You can connect
	  the transducer that produces a voltage representing the
	  fluid level to a single channel on the measurement device
	  and initiate a single-channel, single-point acquisition when
	  you want to know the fluid level.
	</para>
      </section>
      <section id="s1s2">
	<name>Acquire n Samples</name>
	<para id="s1s2p1">
	  One way to acquire multiple samples for one or more channels
	  is to acquire single samples in a repetitive
	  manner. However, acquiring a single data sample on one or
	  more channels over and over is inefficient and time
	  consuming. Moreover, you do not have accurate control over
	  the time between each sample or channel. Instead you can use
	  hardware timing, which uses a buffer in computer memory, to
	  acquire data more efficiently. Programmatically, you need to
	  include the timing function and specify the <code>sample
	  rate</code> and the <code>sample mode (finite)</code>. As
	  with other functions, you can acquire multiple samples for a
	  single channel or multiple channels.
	</para>
	<para id="s1s2p2">
	  With NI-DAQmx, you also can gather data from multiple
	  channels. For instance, you might want to monitor both the
	  fluid level in the tank and the temperature. In such a case,
	  you need two transducers connected to two channels on the
	  device.
	</para>
      </section>
      <section id="s1s3">
	<name>Acquire Continuously</name>
	<para id="s1s3p1">
	  If you want to view, process, or log a subset of the samples
	  as they are acquired, you need to continually acquire
	  samples. For these types of applications, set the
	  <code>sample mode</code> to <code>continuous</code>.
	</para>
      </section>
    </section>
    <section id="s2">
      <name>Task Triggering</name>
      <para id="s2p1">
	When a device controlled by NI-DAQmx does something, it
	performs an action. Two very common actions are producing a
	sample and starting a waveform acquisition. Every NI-DAQmx
	action needs a stimulus or cause. When the stimulus occurs,
	the action is performed. Causes for actions are called
	<term>triggers</term>. The start trigger starts the
	acquisition. The reference trigger establishes the reference
	point in a set of input samples. Data acquired up to the
	reference point is pretrigger data. Data acquired after the
	reference point is posttrigger data.
      </para>
    </section>
  </content>
  
</document>
