1COMEDI_TO_PHYS(3) Comedi reference COMEDI_TO_PHYS(3)
2
3
4
6 comedi_to_phys - convert sample to physical units
7
9 #include <comedilib.h>
10
11 double comedi_to_phys(lsampl_t data, comedi_range * range,
12 lsampl_t maxdata);
13
15 Converts parameter data given in sample values (lsampl_t, between 0 and
16 maxdata) into physical units (double). The parameter range represents
17 the conversion information to use, and the parameter maxdata represents
18 the maximum possible data value for the channel that the data was read.
19 The mapping between physical units is linear and assumes ideal
20 converter characteristics.
21
22 Conversion of endpoint sample values, that is, sample values equal to 0
23 or maxdata, is affected by the Comedilib out-of-range behavior (see
24 function comedi_set_global_oor_behavior). If the out-of-range behavior
25 is set to COMEDI_OOR_NAN, endpoint values are converted to NAN. If the
26 out-of-range behavior is set to COMEDI_OOR_NUMBER, the endpoint values
27 are converted similarly to other values.
28
29 If there is an error, NAN is returned.
30
32 David Schleef <ds@schleef.org>
33 Author.
34
35 Frank Mori Hess <fmhess@users.sourceforge.net>
36 Author.
37
38 Herman Bruyninckx <Herman.Bruyninckx@mech.kuleuven.ac.be>
39 Author.
40
41 Bernd Porr <tech@linux-usb-daq.co.uk>
42 Author.
43
44 Ian Abbott <abbotti@mev.co.uk>
45 Author.
46
47 Éric Piel <piel@delmic.com>
48 Author.
49
51 Copyright © 1998-2003 David Schleef
52 Copyright © 2001-2003, 2005, 2008 Frank Mori Hess
53 Copyright © 2002-2003 Herman Bruyninckx
54 Copyright © 2012 Bernd Porr
55 Copyright © 2012 Ian Abbott
56 Copyright © 2012, 2015 Éric Piel
57
58 This document is part of Comedilib. In the context of this document,
59 the term "source code" as defined by the license is interpreted as the
60 XML source.
61
62 This library is free software; you can redistribute it and/or modify it
63 under the terms of the GNU Lesser General Public License as published
64 by the Free Software Foundation, version 2.1 of the License.
65
66 This library is distributed in the hope that it will be useful, but
67 WITHOUT ANY WARRANTY; without even the implied warranty of
68 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
69 General Public License for more details.
70
71 You should have received a copy of the GNU Lesser General Public
72 License along with this library; if not, write to the Free Software
73 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
74 USA.
75
76
77
78
79Comedi 05/11/2017 COMEDI_TO_PHYS(3)