1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>comedi_to_phys</title><link rel="stylesheet" type="text/css" href="comedilib.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="index.html" title="Comedi"><link rel="up" href="functionreference.html#idm2224" title="5.4.1. Core Functions"><link rel="prev" href="func-ref-comedi-set-global-oor-behavior.html" title="comedi_set_global_oor_behavior"><link rel="next" href="func-ref-comedi-to-physical.html" title="comedi_to_physical"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">comedi_to_phys</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="func-ref-comedi-set-global-oor-behavior.html">Prev</a> </td><th width="60%" align="center">5.4.1. Core Functions</th><td width="20%" align="right"> <a accesskey="n" href="func-ref-comedi-to-physical.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="func-ref-comedi-to-phys"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>comedi_to_phys — convert sample to physical units</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include <comedilib.h></pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">double <b class="fsfunc">comedi_to_phys</b>(</code></td><td>lsampl_t <var class="pdparam">data</var>, </td></tr><tr><td> </td><td>comedi_range * <var class="pdparam">range</var>, </td></tr><tr><td> </td><td>lsampl_t <var class="pdparam">maxdata</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idm3473"></a><h2>
Description
</h2><p>
Converts parameter <em class="parameter"><code>data</code></em> given in sample values
(<span class="type">lsampl_t</span>, between <code class="literal">0</code> and
<em class="parameter"><code>maxdata</code></em>) into physical units
(<span class="type">double</span>). The parameter <em class="parameter"><code>range</code></em>
represents the conversion information to use, and the parameter
<em class="parameter"><code>maxdata</code></em> represents the maximum possible data value for the
channel that the data was read. The mapping between physical units
is linear and assumes ideal converter characteristics.
</p><p>
Conversion of endpoint sample values, that is, sample values
equal to <code class="literal">0</code> or <em class="parameter"><code>maxdata</code></em>,
is affected by the Comedilib out-of-range
behavior (see function <code class="function"><a class="link" href="func-ref-comedi-set-global-oor-behavior.html" title="comedi_set_global_oor_behavior">comedi_set_global_oor_behavior</a></code>).
If the out-of-range behavior is set to
<code class="constant">COMEDI_OOR_NAN</code>,
endpoint values are converted to <code class="constant">NAN</code>. If the out-of-range
behavior is set to <code class="constant">COMEDI_OOR_NUMBER</code>, the endpoint values are
converted similarly to other values.
</p><p>
If there is an error, <code class="constant">NAN</code> is returned.
</p><p>
</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="func-ref-comedi-set-global-oor-behavior.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="functionreference.html#idm2224">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="func-ref-comedi-to-physical.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">comedi_set_global_oor_behavior </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> comedi_to_physical</td></tr></table></div></body></html>
|