Specifications
Comedi
6 / 148
• [2] - DMA 1
• [3] - DMA 2
• [4] - AI jumpered for 0=single ended, 1=differential
• [5] - AI jumpered for 0=straight binary, 1=2’s complement
• [6] - AO 0 jumpered for 0=straight binary, 1=2’s complement
• [7] - AO 1 jumpered for 0=straight binary, 1=2’s complement
• [8] - AI jumpered for 0=[-10,10]V, 1=[0,10], 2=[-5,5], 3=[0,5]
• [9] - AO 0 jumpered for 0=[-10,10]V, 1=[0,10], 2=[-5,5], 3=[0,5], 4=[-2.5,2.5]
• [10]- A0 1 jumpered for 0=[-10,10]V, 1=[0,10], 2=[-5,5], 3=[0,5], 4=[-2.5,2.5]
So, the appropriate options list might be:
0x200,4,0,0,1,1,1,1,0,2,2
and the full configuration command is:
comedi_config /dev/comedi1 dt2821-f-8di 0x200,4,0,0,1,1,1,1,0,2,2
Setting the DMA channels to 0 disables the use of DMA.
So now you have your boards configured correctly. Since data acquisition boards are not typically well-engineered, Comedi
sometimes can’t figure out if an old non-plug-n-play board is actually in the computer and at the base address you specified. If it
can’t, it assumes you are right. Both of these boards are well-made, so Comedi will give an error message if it can’t find them.
The Comedi kernel module, since it is a part of the kernel, prints messages to the kernel logs, which you can access through the
command dmesg or the file /var/log/messages. Here is a configuration failure (from dmesg):
comedi0: ni_atmio: 0x0200 can’t find board
When it does work, you get:
comedi0: ni_atmio: 0x0260 at-mio-16e-10 ( irq = 3 )
Note that it also correctly identified the board.
2.2 Getting information about a card
So now that you have Comedi talking to the hardware, try to talk to Comedi. Call the command comedi_board_info, which
provides information about each subdevice on the board. Here’s part of the output for the USB-DUX sigma board (which is on
/dev/comedi0), as a result of the command comedi_board_info -v.
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