1
.\" This manpage has been automatically generated by docbook2man
2
.\" from a DocBook document. This tool can be found at:
3
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
4
.\" Please send any bug reports, improvements, comments, patches,
5
.\" etc. to Steve Cheng <steve@ggi-project.org>.
6
.TH "COMEDI_DATA_READ" "3" "02 October 2004" "" ""
9
comedi_data_read \- read single sample from channel
12
\fB#include <comedilib.h>
14
int comedi_data_read (comedi_t * \fIdevice\fB, unsigned int \fIsubdevice\fB, unsigned int \fIchannel\fB, unsigned int \fIrange\fB, unsigned int \fIaref\fB, lsampl_t * \fIdata\fB);
18
Reads a single sample on the channel specified by the Comedi
19
device device, the subdevice subdevice, and the channel channel.
20
For the A/D conversion (if appropriate),
21
the device is configured to use range specification
22
range and (if appropriate) analog reference type
23
aref. Analog reference types that are not supported
24
by the device are silently ignored.
26
The function comedi_data_read() reads one data value from
27
the specified channel and places the data value in the
28
location pointed to by data.
30
WARNING: comedi_data_read() does not do any pausing to
31
allow multiplexed analog inputs to settle before
32
performing an analog to digital conversion. If you are
33
switching between different channels and need to allow
34
your analog input to settle for an accurate reading,
35
use comedi_data_read_delayed(), or set the
36
input channel at an earlier time with
37
comedi_data_read_hint().
39
On sucess, comedi_data_read() returns 1 (the number of samples
40
read). If there is an error, -1 is returned.
42
Data values returned by this function are unsigned integers
43
less than or equal to the maximum sample value of the channel,
44
which can be determined using the function comedi_get_maxdata().
45
Conversion of data values to physical units can be performed
46
by the function comedi_to_phys().