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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>2.2. Getting information about a card</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="install.html" title="2. Configuration"><link rel="prev" href="install.html" title="2. Configuration"><link rel="next" href="writingprograms.html" title="3. Writing Comedi programs"></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">2.2.
Getting information about a card
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="install.html">Prev</a> </td><th width="60%" align="center">2.
Configuration
</th><td width="20%" align="right"> <a accesskey="n" href="writingprograms.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="gettinginformation"></a>2.2.
Getting information about a card
</h3></div></div></div><p>
So now that you have <a class="ulink" href="http://www.comedi.org" target="_top"><acronym class="acronym">Comedi</acronym></a> talking to the hardware, try to
talk to <a class="ulink" href="http://www.comedi.org" target="_top"><acronym class="acronym">Comedi</acronym></a>.
Call the command <span class="command"><strong>comedi_board_info</strong></span>, which provides information
about each subdevice on the board.
Here's part of the output for the USB-DUX sigma
board (which is on <code class="filename">/dev/comedi0</code>), as a result of
the command <span class="command"><strong>comedi_board_info -v</strong></span>.
</p><pre class="screen">
overall info:
version code: 0x00074c
driver name: usbduxsigma
board name: usbduxsigma
number of subdevices: 4
subdevice 0:
type: 1 (analog input)
flags: 0x10119000
SDF_CMD_READ:can do asynchronous input commands
SDF_READABLE:subdevice can be read
SDF_GROUND:can do aref=ground
SDF_LSAMPL:subdevice uses 32-bit samples for commands
number of channels: 16
max data value: 16777215
ranges:
all chans: [-1.325 V,1.325 V]
command:
start: now|int
scan_begin: timer
convert: now
scan_end: count
stop: none|count
command structure filled with probe_cmd_generic_timed for 16 channels:
start: now 0
scan_begin: timer 1000000
scan_begin_src = TRIG_TIMER:
The sampling rate is defined per scan
meaning all channels are sampled at
the same time. The maximum sampling rate is f=1000 Hz
convert: now 0
scan_end: count 16
stop: count 2
subdevice 1:
type: 2 (analog output)
flags: 0x00125000
SDF_CMD_WRITE:can do asynchronous output commands
SDF_WRITABLE:subdevice can be written
SDF_GROUND:can do aref=ground
number of channels: 4
max data value: 255
ranges:
all chans: [0 V,2.5 V]
command:
start: now|int
scan_begin: timer
convert: now
scan_end: count
stop: none|count
command structure filled with probe_cmd_generic_timed for 4 channels:
start: now 0
scan_begin: timer 1000000
scan_begin_src = TRIG_TIMER:
The sampling rate is defined per scan
meaning all channels are sampled at
the same time. The maximum sampling rate is f=1000 Hz
convert: now 0
scan_end: count 4
stop: count 2
subdevice 2:
type: 5 (digital I/O)
flags: 0x00030000
SDF_READABLE:subdevice can be read
SDF_WRITABLE:subdevice can be written
number of channels: 24
max data value: 1
ranges:
all chans: [0 V,5 V]
command:
not supported
subdevice 3:
type: 12 (pwm)
flags: 0x00020100
SDF_MODE1:can do mode 1
SDF_WRITABLE:subdevice can be written
number of channels: 8
max data value: 512
ranges:
all chans: [0,1]
command:
not supported
</pre><p>
This board has four subdevices. Devices are separated into
subdevices that each have a distinct purpose; e.g., analog
input, analog output, digital input/output.
</p><p>
Here's the information from <a class="ulink" href="http://www.comedi.org" target="_top"><acronym class="acronym">Comedi</acronym></a>'s <code class="filename">/proc/comedi</code>
file, which indicates what drivers are loaded and which
boards are configured:
</p><pre class="screen">
cat /proc/comedi
</pre><pre class="screen">
comedi version 0.7.76
format string: "%2d: %-20s %-20s %4d",i,driver_name,board_name,n_subdevices
0: usbduxsigma usbduxsigma 4
usbduxfast:
usbduxfast
usbduxsigma:
usbduxsigma
</pre><p>
This documentation feature currently returns the driver name, the device name, and the number of
subdevices. Following those lines are a list of the <a class="ulink" href="http://www.comedi.org" target="_top"><acronym class="acronym">Comedi</acronym></a> kernel
driver modules currently loaded, each followed by a list of the board
names it recognizes (names that can be used with
<span class="command"><strong>comedi_config</strong></span>).
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="install.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="install.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="writingprograms.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2.
Configuration
</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.
Writing <acronym class="acronym">Comedi</acronym> programs
</td></tr></table></div></body></html>
|