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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>comedi_apply_calibration</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#idm4383" title="5.4.3. Calibration"><link rel="prev" href="func-ref-comedi-set-write-subdevice.html" title="comedi_set_write_subdevice"><link rel="next" href="func-ref-comedi-apply-parsed-calibration.html" title="comedi_apply_parsed_calibration"></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_apply_calibration</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="func-ref-comedi-set-write-subdevice.html">Prev</a> </td><th width="60%" align="center">5.4.3. Calibration</th><td width="20%" align="right"> <a accesskey="n" href="func-ref-comedi-apply-parsed-calibration.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="func-ref-comedi-apply-calibration"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>comedi_apply_calibration — set hardware calibration from file</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">int <b class="fsfunc">comedi_apply_calibration</b>(</code></td><td>comedi_t * <var class="pdparam">device</var>, </td></tr><tr><td> </td><td>unsigned int <var class="pdparam">subdevice</var>, </td></tr><tr><td> </td><td>unsigned int <var class="pdparam">channel</var>, </td></tr><tr><td> </td><td>unsigned int <var class="pdparam">range</var>, </td></tr><tr><td> </td><td>unsigned int <var class="pdparam">aref</var>, </td></tr><tr><td> </td><td>const char * <var class="pdparam">file_path</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idm4419"></a><h2>
Status
</h2><p>
alpha
</p></div><div class="refsect1"><a name="idm4422"></a><h2>
Description
</h2><p>
The function <code class="function">comedi_apply_calibration</code> sets the
hardware calibration for the subdevice specified by
<em class="parameter"><code>device</code></em> and
<em class="parameter"><code>subdevice</code></em>
so that it is in proper calibration when using the channel specified by
<em class="parameter"><code>channel</code></em>,
range index specified by <em class="parameter"><code>range</code></em> and
analog reference specified by <em class="parameter"><code>aref</code></em>.
It does so by performing writes
to the appropriate channels of the board's calibration
subdevice(s). Depending on the hardware, the
calibration settings used may or may not depend on the channel,
range, or analog reference. Furthermore, the calibrations appropriate
for different channel, range, and analog reference parameters
may not be able to be applied simultaneously.
For example, some boards cannot have their analog inputs calibrated
for more than one input range simultaneously. Applying a calibration for range 1 may
blow away a previously applied calibration for range 0. Or, applying
a calibration for analog input channel 0 may cause the same
calibration to be applied to all the
other analog input channels as well.
Your only guarantee is that calls to
<code class="function">comedi_apply_calibration</code>
on different subdevices will not interfere with each other.
</p><p>
In practice, their are some rules of thumb on how
calibrations behave. No calibrations depend on the analog reference.
A multiplexed analog input will have calibration settings that
do not depend on the channel, and applying a setting for one
channel will affect
all channels equally. Analog outputs, and analog inputs
with independent a/d converters for each input channel, will have
calibration settings which do depend on the channel, and the
settings for each channel will be independent of the other
channels.
</p><p>
If you wish to investigate exactly what
<code class="function">comedi_apply_calibration</code>
is doing, you can perform reads on your board's calibration
subdevice to see which calibration channels it is changing.
You can also try to decipher the calibration file directly (it's a
text file).
</p><p>
The <em class="parameter"><code>file_path</code></em> parameter can be used
to specify the file which contains the calibration information.
If <em class="parameter"><code>file_path</code></em> is
<code class="constant">NULL</code>, then Comedilib
will use a default
file location. The calibration information used by this function
is generated by the <span class="command"><strong>comedi_calibrate</strong></span> program (see its man page).
</p><p>
The functions
<code class="function"><a class="link" href="func-ref-comedi-parse-calibration-file.html" title="comedi_parse_calibration_file">comedi_parse_calibration_file</a></code>,
<code class="function"><a class="link" href="func-ref-comedi-apply-parsed-calibration.html" title="comedi_apply_parsed_calibration">comedi_apply_parsed_calibration</a></code>,
and <code class="function"><a class="link" href="func-ref-comedi-cleanup-calibration.html" title="comedi_cleanup_calibration">comedi_cleanup_calibration</a></code>
provide the same functionality at a slightly lower level.
</p></div><div class="refsect1"><a name="idm4447"></a><h2>
Return value
</h2><p>
Returns <code class="literal">0</code> on success, <code class="literal">-1</code> on failure.
</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-write-subdevice.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="functionreference.html#idm4383">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="func-ref-comedi-apply-parsed-calibration.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">comedi_set_write_subdevice </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> comedi_apply_parsed_calibration</td></tr></table></div></body></html>
|