2.2. Getting information about a card
Prev | 2. Configuration | Next

### 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
      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

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.

Here's the information from Comedi's `/proc/comedi` file, which indicates what drivers are loaded and which boards are configured:

    cat /proc/comedi

    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

This documentation feature currently returns the driver name, the device name, and the number of subdevices. Following those lines are a list of the Comedi kernel driver modules currently loaded, each followed by a list of the board names it recognizes (names that can be used with comedi_config).

Prev | Up | Next
2. Configuration | Home | 3. Writing Comedi programs