Using gpib library with Beiming Technologies S82357

Allan <[email protected]>
Newsgroups gmane.linux.hardware.gpib.general
Message-ID <[email protected]>
I could use your help figuring out what I am doing wrong in my feeble 
attempt at using the linux-gpib library. I am trying to use the 
linux-gpib library to interface with a Beiming Technologies S82357 USB 
to gpib adapter and an Agilent 4268A capacitance meter. My end goal is 
to get capacitance and dissipation factor measurements from this 
instrument. Currently I have successfully compiled the linux-gpib 
sources by using,

./configure
make
sudo make install

The issues I am having are not being able to open the Agilent 4268A 
instrument from the ibtest or ibterm programs. When attempting to use 
either of these two programs there is an error message in the syslog 
that reads,

May 18 13:09:58 allan-mi kernel: [ 1975.850775] gpib: ioctl 3 invalid 
for offline board
May 18 13:09:58 allan-mi kernel: [ 1975.850821] gpib: ioctl 5 invalid 
for offline board
May 18 13:09:58 allan-mi kernel: [ 1975.850836] gpib: ioctl 5 invalid 
for offline board

Other times I will get the following error messages,

May 18 12:33:01 allan-mi kernel: [49674.574631] gpib: interface attach 
failed
May 18 12:38:07 allan-mi kernel: [   64.014752] agilent_82357a_gpib 
driver loadingprobe succeeded for path: usb-0000:00:14.0-4
May 18 12:38:07 allan-mi kernel: [   64.014796] usbcore: registered new 
interface driver agilent_82357a_gpib
May 18 12:38:07 allan-mi kernel: [   64.014799] gpib: registered 
agilent_82357a interface
May 18 12:40:00 allan-mi kernel: [  176.966179] gpib: no gpib board 
configured on /dev/gpib0
May 18 12:40:00 allan-mi kernel: [  176.966209] gpib: no gpib board 
configured on /dev/gpib0
May 18 12:40:00 allan-mi kernel: [  176.966218] gpib: no gpib board 
configured on /dev/gpib0
May 18 12:45:37 allan-mi kernel: [  514.809951] gpib: no gpib board 
configured on /dev/gpib0
May 18 12:45:37 allan-mi kernel: [  514.809996] gpib: no gpib board 
configured on /dev/gpib0
May 18 12:45:37 allan-mi kernel: [  514.810010] gpib: no gpib board 
configured on /dev/gpib0

Any advice you could give would be a great help.

Thanks,

Allan Overstreet



I have also downloaded the firmware and copied it into the 
/usr/share/usb/agilent_82357a directory. The firmware is also located in 
~/software/linux-gpib/gpib_firmware-2008-08-10/

Below is my gpib.conf file in /etc/gpib.conf

/***********************************************************************
                  GPIB.CONF IEEE488 library config file
                              -------------------

    copyright            : (C) 2002 by Frank Mori Hess
                           (C) 1994 by C.Schroeter
    email                : [email protected]
  ***************************************************************************/
/***************************************************************************
  *
  *   Syntax:
  *
  *         interface { ... } starts new interface board section
  *         device {...} device configuration
  *
  ***************************************************************************/

/* This section configures the configurable driver characteristics
  * for an interface board, such as board address, and interrupt level.
  * minor = 0 configures /dev/gpib0, minor = 1 configures /dev/gpib1, etc.
  */

interface {
     minor = 0    /* board index, minor = 0 uses /dev/gpib0, minor = 1 
uses /dev/gpib1, etc. */
     board_type = "agilent_82357a"    /* type of interface board being 
used */
     name = "usb_china"    /* optional name, allows you to get a board 
descriptor using ibfind() */
     pad = 0    /* primary address of interface             */
     sad = 0    /* secondary address of interface           */
     timeout = T3s    /* 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 = 0    /* Base io ADDRESS                  */
     irq  = 0    /* Interrupt request level */
     dma  = 0    /* DMA channel (zero disables)      */

/* pci_bus and pci_slot can be used to distinguish two pci boards 
supported by the same driver */
/*    pci_bus = 0 */
/*    pci_slot = 7 */

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

/* This is how you might set up a pcIIa board on /dev/gpib1, uncomment 
to use. */
/*******************
interface {
     minor = 1
     board_type = "pcIIa"
     pad = 0
     sad = 0
     timeout = T3s

     eos = 0x0a
     set-reos = yes
     set-bin = no

     base = 0x2e1
     irq  = 7
     dma  = 1

     master = yes
}
*********************/

/* Now the device sections define the device characteristics for each 
device.
  * These are only used if you want to open the device using ibfind() 
(instead
  * of ibdev() )
  */

device {
     minor = 0    /* minor number for interface board this device is 
connected to */
     name = "agilent_4268A"    /* device mnemonic */
     pad = 18    /* The Primary Address */
     sad = 0        /* Secondary Address */

     eos = 0xa    /* EOS Byte */
     set-reos = no /* Terminate read if EOS */
     set-bin = no /* Compare EOS 8-bit */
}

device {
     minor = 0
     name = "scope"
     pad = 8
     sad = 0
}

I also modified a hot plug script in the /etc/hotplug/usb/agilent_82357a 
file. This is listed below,

#!/bin/sh

GPIB_CONFIG_OPTIONS="--minor 0"
DATADIR=/usr/share
FXLOAD=fxload
FXLOAD_OPTIONS=

PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin
FIRMWARE=/home/allan/software/linux-gpib/gpib_firmware-2008-08-10/

# pre-renumeration device IDs
case $PRODUCT in
# 82357a with firmware already loaded
957/107/*)
     gpib_config $GPIB_CONFIG_OPTIONS
     ;;

# 82357a without firmware
957/7/*)
     FIRMWARE=$DATADIR/usb/agilent_82357a/82357a_fw.hex
     ;;

# 82357b with firmware already loaded
957/718/*)
     gpib_config $GPIB_CONFIG_OPTIONS
     ;;

# 82357b without firmware
957/518/*)
     FIRMWARE=$DATADIR/usb/agilent_82357a/measat_releaseX1.8.hex
     FXLOAD_OPTIONS="-t fx2"
     ;;

esac


# quit unless we were called to download some firmware
if [ "$FIRMWARE" = "" ]; then
     # OR:  restructure to do other things for
     # specific post-renumeration devices
     exit 0
fi

# missing firmware?
if [ ! -r $FIRMWARE ]; then
     if [ -x /usr/bin/logger ]; then
     /usr/bin/logger -t $0 "missing $FIRMWARE for $PRODUCT ??"
     fi
     exit 1
fi

# missing fxload?
if ! which $FXLOAD; then
     if [ -x /usr/bin/logger ]; then
     /usr/bin/logger -t $0 "missing $FXLOAD ??"
     fi
     exit 1
fi

if [ -x /usr/bin/logger ]; then
     /usr/bin/logger -t $0 "load $FIRMWARE for $PRODUCT to $DEVICE"
fi

$FXLOAD $FXLOAD_OPTIONS -I $FIRMWARE

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Linux-gpib-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-gpib-general
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.