Comedi

This example is for Comedi - The Linux Control and Measurement Interface


C

On Debian 7 32-bit i386 we installed the libcomedi0, libcomedi-dev, and tcc (the www.TinyCC.org compiler) packages.  Then in a terminal (as root) at each reboot we do:
  modprobe comedi comedi_num_legacy_minors=4
  modprobe comedi_test
  comedi_config /dev/comedi0 comedi_test

From http://www.comedi.org/download.html download:
comedilib-0.10.1 (Released 2012-08-28)
Extract the above compressed archive, then open a terminal in the comedi_board_info folder.

In the terminal:
Compile: tcc -L/usr/lib -lcomedi -o info comedi_board_info.c
Run: ./info

On our Debian system the program displays:
overall info:
  version code: 0x00074c
  driver name: comedi_test
  board name: comedi_test
  number of subdevices: 2
subdevice 0:
  type: 1 (analog input)
  flags: 0x00119000
  number of channels: 8
  max data value: 65535
  ranges:
    all chans: [-10 V,10 V] [-5 V,5 V]
  command:
    start: now
    scan_begin: timer
    convert: now|timer
    scan_end: count
    stop: none|count
  command structure filled with probe_cmd_generic_timed for 1 channels:
    start: now 0
    scan_begin: timer 1000
    convert: now 0
    scan_end: count 1
    stop: count 2
subdevice 1:
  type: 2 (analog output)
  flags: 0x00120000
  number of channels: 8
  max data value: 65535
  ranges:
    all chans: [-10 V,10 V] [-5 V,5 V]
  command:
    not supported


Python

Here we hope to document a simple way to use Python.  There is some recent code here.


Pascal

We are using Lazarus Free Pascal code obtained from this site:
http://github.com/chandranorth
Which is related to this site:
http://www.nano.northwestern.edu/

On Debian 7 32-bit i386 we installed the libcomedi0 and libcomedi-dev packages.  Then in a terminal (as root) at each reboot we do:
  modprobe comedi comedi_num_legacy_minors=4
  modprobe comedi_test
  comedi_config /dev/comedi0 comedi_test

If you get compiler errors when compiling on Linux you might need to install linux libraries.

Win32 - comedi is not supported on Windows

Want more information on compiling? The "Hello World" page has a tutorial for Win32.  The "Simple Serial" page also has a tutorial.

Linux - hellocomedi-fpc-2.6.2.i386-linux-011714.zip 1.8 MB
Unzip the files into a new folder
Open a Terminal in the new folder
Set compiler as executable file: chmod 755 ppc386
Copy libcomedi.a from /usr/lib to current folder
Compile the program: sh hellocomedi.sh
Run the program that is in the bin folder: ./bin/hellocomedi
Previous releases:
  hellocomedi-fpc-2.6.2.i386-linux-121013.zip 1.9 MB

On our Debian system the program displays:
hellocomedi started
started get_board_names
get_board_names testing board: /dev/comedi0
get_board_names got board: /dev/comedi0
board_name: comedi_test
version_code (hex): 00074C
n_subdevs: 2
read_subdevice: 0
write_subdevice: 1
get_board_names testing board: /dev/comedi1
get_board_names testing board: /dev/comedi2
hellocomedi done


Return to home page.

Please share your ideas, comments and suggestions. Thanks!