1COMEDI_FROM_PHYS(3)            Comedi reference            COMEDI_FROM_PHYS(3)
2
3
4

NAME

6       comedi_from_phys - convert physical units to sample
7

SYNOPSIS

9       #include <comedilib.h>
10
11       lsampl_t comedi_from_phys(double data, comedi_range * range,
12                                 lsampl_t maxdata);
13

DESCRIPTION

15       Converts parameter data given in physical units (double) into sample
16       values (lsampl_t, between 0 and maxdata). The parameter range
17       represents the conversion information to use, and the parameter maxdata
18       represents the maximum possible data value for the channel that the
19       data will be written to. The mapping between physical units and raw
20       data is linear and assumes that the converter has ideal
21       characteristics.
22
23       Conversion is not affected by out-of-range behavior. Out-of-range data
24       parameters are silently truncated to the range 0 to maxdata.
25

AUTHORS

27       David Schleef <ds@schleef.org>
28           Author.
29
30       Frank Mori Hess <fmhess@users.sourceforge.net>
31           Author.
32
33       Herman Bruyninckx <Herman.Bruyninckx@mech.kuleuven.ac.be>
34           Author.
35
36       Bernd Porr <tech@linux-usb-daq.co.uk>
37           Author.
38
39       Ian Abbott <abbotti@mev.co.uk>
40           Author.
41
42       Éric Piel <piel@delmic.com>
43           Author.
44
46       Copyright © 1998-2003 David Schleef
47       Copyright © 2001-2003, 2005, 2008 Frank Mori Hess
48       Copyright © 2002-2003 Herman Bruyninckx
49       Copyright © 2012 Bernd Porr
50       Copyright © 2012 Ian Abbott
51       Copyright © 2012, 2015 Éric Piel
52
53       This document is part of Comedilib. In the context of this document,
54       the term "source code" as defined by the license is interpreted as the
55       XML source.
56
57       This library is free software; you can redistribute it and/or modify it
58       under the terms of the GNU Lesser General Public License as published
59       by the Free Software Foundation, version 2.1 of the License.
60
61       This library is distributed in the hope that it will be useful, but
62       WITHOUT ANY WARRANTY; without even the implied warranty of
63       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
64       General Public License for more details.
65
66       You should have received a copy of the GNU Lesser General Public
67       License along with this library; if not, write to the Free Software
68       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
69       USA.
70
71
72
73
74Comedi                            05/11/2017               COMEDI_FROM_PHYS(3)
Impressum