1 <!-- <!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook V3.1//EN"> -->
9 This section assumes that you have successfully compiled and installed
10 the &comedi; software, that your hardware device is in your computer,
11 and that you know the relevant details about it, i.e., what kind of
12 card it is, the I/O base, the IRQ, jumper settings related to input
17 <section id="cardconfiguration">
22 Before being able to get information from a DAQ card, you first have
23 to tell the &comedi; core kernel module which device you have, which
24 driver you want to attach to the card, and which run-time options
25 you want to give to the driver. This configuration is done by running
26 the <command>comedi_config</command> command. (As root of course.)
27 Here is an example of how to use the command (perhaps you should read
28 its <command>man</command> page now):
30 PATH=/sbin:/usr/sbin:/usr/local/sbin:$PATH
31 comedi_config /dev/comedi0 labpc-1200 0x260,3
33 This command says that the <quote>file</quote>
34 <filename>/dev/comedi0</filename> can be used to access the &comedi;
35 device that uses the <parameter>labpc-1200</parameter> board, and that
36 you give it two run-time parameters (<literal>0x260</literal> and
37 <literal>3</literal>). More parameters are possible, for example to
38 discriminate between two or more identical cards in your system.
41 If you want to have the board configured in this way every time you
42 boot, put the lines above into a start-up script file of your Linux
43 system (for example, the
44 <filename>/etc/rc.d/rc.local</filename> file), or for PCMCIA
45 boards the appropriate place is the /etc/pcmcia/comedi script.
46 For non-PCMCIA boards, you can also arrange to have your driver
47 loaded and comedi_config run with by adding a few lines
48 to /etc/modules.conf (see the INSTALL file for the comedi
49 kernel modules). You can, of course, also run comedi_config
54 This tutorial goes through the process of configuring &comedi;
56 <literal>National Instruments AT-MIO-16E-10</literal>, and a
57 <literal>Data Translation DT2821-F-8DI</literal>.
61 The NI board is plug-and-play. The current ni_atmio driver
62 has kernel-level ISAPNP support, which is used by default
63 if you do not specify a base address. So you could simply
66 comedi_config /dev/comedi0 ni_atmio
71 For the <literal>Data Translation</literal> board, you need to have a
72 list of the jumper settings; these are given in the &comedi; manual
73 section about this card. (Check first to see whether they are still
75 The card discussed her is a <literal>DT2821-f-8di</literal>. The
76 <command>man</command> page of <command>comedi_config</command> tells
77 you that you need to know the I/O base, IRQ, DMA 1, DMA 2. However,
78 the &comedi; driver also recognizes the
79 differential/single-ended and unipolar/bipolar jumpers. As always,
80 the source is the final authority, and looking in
81 <filename>module/dt282x.c</filename>
82 tells us that the options list is interpreted as:
85 (... TO BE FILLED IN ...)
92 <item>1=differential, 0=single ended
93 <item>ai 0=unipolar, 1=bipolar
94 <item>ao0 0=unipolar, 1=bipolar
95 <item>ao1 0=unipolar, 1=bipolar
99 (ai=analog input, ao=analog output.)
103 So, the appropriate options list is:
107 and the full configuration command is:
109 comedi_config /dev/comedi1 dt2821-f-8di 0x200,4,,1,1,1
111 The differential/single-ended number is left blank, since the
112 driver already knowns (from the board name), that it is
113 differential. Also the DMA numbers are left blank, since we
114 don't want the driver to use DMA. (Which could interfere
115 with the sound card...)
116 Keep in mind that things commented in the source, but not in
117 the documentation are about as likely to change as the weather,
118 so put good comments next to the following line when you put
119 it in a start-up file.
123 So now you have your boards configured correctly.
124 Since data acquisition boards are not typically well-engineered,
125 &comedi; sometimes can't figure out if the board is actually there.
126 If it can't, it assumes you are right. Both of these boards
127 are well-made, so &comedi; will give an error message if it
128 can't find them. The &comedi; kernel module, since it is a part
129 of the kernel, prints messages to the kernel logs, which you
130 can access through the command <command>dmesg</command> or the file
131 <filename>/var/log/messages</filename>.
132 Here is a configuration failure (from <command>dmesg</command>):
136 comedi0: ni_atmio: 0x0200 can't find board
140 When it does work, you get:
144 comedi0: ni_atmio: 0x0260 at-mio-16e-10 ( irq = 3 )
148 Note that it also correctly identified the board.
153 <section id="gettinginformation">
155 Getting information about a card
159 So now that you have &comedi; talking to the hardware, try to
160 talk to &comedi;. Here's some pretty low-level information, which can
161 sometimes be useful for debugging:
169 On the particular system this demonstration was carried out, this
176 0: ni_atmio at-mio-16e-10 7
177 1: dt282x dt2821-f-8di 4
181 This documentation feature is not well-developed yet. Basically, it
182 currently returns the driver name, the device name, and the number of
187 In the <filename role=directory>demo/</filename> directory, there is a
188 command called <command>info</command>, which provides information
189 about each subdevice on the board. Its output can be rather long,
190 if the board has several subdevices.
191 Here's part of the output of the <literal>National Instruments</literal>
192 board (which is on <filename>/dev/comedi0</filename>), as a result of
193 the command <command>demo/info /dev/comedi0</command>:
198 version code: 0x000604
199 driver name: ni_atmio
200 board name: at-mio-16e-10
201 number of subdevices: 7
203 type: 1 (analog input)
204 number of channels: 16
210 The overall info gives information about the device; basically
211 the same information as <filename>/proc/comedi</filename>.
215 This board has seven subdevices. Devices are separated into
216 subdevices that each have a distinct purpose; e.g., analog
217 input, analog output, digital input/output. This board also
218 has an EEPROM and calibration DACs that are also subdevices.
222 &comedi; has more information about the device than what is displayed
223 above, but <command>demo/info</command> doesn't currently display