Linux GPIB

since 2015 the microioc contain a ines pc104 board. Formfactor pc104. Pci id 16da:0011

Drivers are from http://linux-gpib.sourceforge.net/ Sourceforge Projekt. GSI is using version 3.2.17

For the ines gpib there is a bug. Coyslab fixed it by just commenting the printk message. We now comment the complete block for register 3,4.

build

The kernel modules and tools are packaged as opkg (kmod-scu-gpib). See https://www-acc.gsi.de/svn/common/embedded/trunk/makepkg/kmod-scu-gpib/

    export KDIR=/path/to/kernel/headers
    cd linux-gpib-$mod_version
    ./configure \
        --with-linux-srcdir=$KDIR \
        --prefix=/ \
        --enable-isa \
        --disable-perl-binding \
        --disable-php-binding \
        --disable-python-binding \
        --disable-tcl-binding \
        --disable-documentation \
        --disable-guile-binding

    make

gpib.conf

for ines
interface {
  minor = 0   /* board index, minor = 0 uses /dev/gpib0, minor = 1 uses /dev/gpib1, etc. */
  board_type = "ines_pci_unaccel"   /* type of interface board being used */
  name = "L0"   /* optional name, allows you to get a board descriptor using ibfind() */
  pad = 0    /* primary address of interface             */
  sad = 0   /* secondary address of interface           */
  timeout = T10s   /* timeout for commands */

  eos = 0x0a   /* EOS Byte, 0xa is newline and 0xd is carriage return */
  set-reos = yes   /* Terminate read if EOS */
  set-bin = no   /* Compare EOS 8-bit */
  set-xeos = no   /* Assert EOI whenever EOS byte is sent */
  set-eot = yes   /* Assert EOI with last byte on writes */

  /* settings for boards that lack plug-n-play capability */
  base = 0x300   /* Base io ADDRESS                  */
  irq  = 7   /* Interrupt request level */
  dma  = 0   /* DMA channel (zero disables)      */

  master = yes   /* interface board is system controller */
}

tests

  1. load kernel modules: modprobe ines_gpib
  2. check gbib.conf
  3. initialize device: gpib_config

testing connection to the board. The name of the board is in /etc/gpib.conf. The flags returned might be different. But there should be iberr=0

[root@khsci04 ~]# ibtest 
Do you wish to open a (d)evice or an interface (b)oard?
   (you probably want to open a device): b
enter name of interface board (or device) you wish to open: L0
trying to open board named 'L0'
You can:
   w(a)it for an event
   write (c)ommand bytes to bus (system controller only)
   send (d)evice clear (device only)
   change remote (e)nable line (system controller only)
   (g)o to standby (release ATN line, system controller only)
   send (i)nterface clear (system controller only)
   ta(k)e control (assert ATN line, system controller only)
   get bus (l)ine status (board only)
   go to local (m)ode
   change end (o)f transmission configuration
   (q)uit
   (r)ead string
   perform (s)erial poll (device only)
   change (t)imeout on io operations
   request ser(v)ice (board only)
   (w)rite data string
: l
DAV off
NDAC off
NRFD off
IFC on
REN on
SRQ on
ATN on
EOI off
gpib status is: 
ibsta = 0x1164  < SRQI CMPL REM CIC LACS >
iberr= 0

ibcnt = 0

testing the connection to the device. First we send a fetch command, then we simply wait for data. No idea how to figure out the device address, but 28 is one at the gsi.

[root@khsci04 ~]# ibtest 
Do you wish to open a (d)evice or an interface (b)oard?
   (you probably want to open a device): d
enter primary gpib address for device you wish to open [0-30]: 28
trying to open pad = 28 on /dev/gpib0 ...
You can:
...
: w
     enter a string to send to your device: :FETC?
     sending string: :FETC?
gpib status is: 
ibsta = 0x2100  < END CMPL >
iberr= 0

[root@khsci04 ~]# ibtest 
Do you wish to open a (d)evice or an interface (b)oard?
   (you probably want to open a device): d
enter primary gpib address for device you wish to open [0-30]: 28
trying to open pad = 28 on /dev/gpib0 ...
You can:
...
: r
enter maximum number of bytes to read [1024]: 
trying to read 1024 bytes from device...
received string: '0
'
Number of bytes read: 3
gpib status is: 
ibsta = 0x2100  < END CMPL >
iberr= 0
Topic revision: r7 - 31 Mar 2016, ChristophHandel
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback