Author Topic: Using a Raspberry PI with linux-gpib - and a Beiming or Agilent USB-GPIB adapter  (Read 78421 times)

0 Members and 1 Guest are viewing this topic.

Offline alm

  • Super Contributor
  • ***
  • Posts: 2881
  • Country: 00
Great that you got the kernel driver working. Indeed, the reference to ni_pci is really odd, especially since the Pi doesn't even have a PCI bus. My guess is also a reference to ni_pcb somewhere in the config file. I don't think linux-gpib has more than just /etc/gpib.conf.

Offline MattSR

  • Regular Contributor
  • *
  • Posts: 95
  • Country: au
In Linux, you can search for files containing a text string using the following command:-

Code: [Select]
grep -R ni_pci
This will recursively search the current directory and any subdirectories for the string “ni_pci”.

Cheers,
Matt
 

Offline Zigzar

  • Newbie
  • Posts: 8
  • Country: gb
Heya,

So i'm looking in /etc and there doesn't appear to be a config file.

If i create one named gpib.conf and paste:

Code: [Select]
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 = "agilent_82357b"
        master = yes                    /*interface board is system controller*/
        pad = 0                         /* primary address of interface */
        sad = 0                         /* secondary address of interface */
        timeout = T3s                   /* timeout for commands */
        eos = 0xa                       /* EOS Byte, 0xa is newline and 0xd is carriage return */
        set-reos = yes                  /* Terminate read if EOS */
        set-bin = yes                   /* Compare EOS 8-bit */
        set-xeos = no                   /* Assert EOI whenever EOS byte is sent */
        set-eot = yes                   /* Assert EOI with last byte on writes */

}

I still get the same error?

Any suggestions?
 

Offline MiDi

  • Frequent Contributor
  • **
  • Posts: 600
  • Country: ua
What does lsusb say?
Did you follow TiNs guide?
This worked for me on rpi b+ about half a year back - despite the fact that I did shortcut with kernel-headers.
I recently got a pi 3, will test it asap...
« Last Edit: November 29, 2018, 01:04:20 am by MiDi »
 

Offline MiDi

  • Frequent Contributor
  • **
  • Posts: 600
  • Country: ua
You have to edit /usr/local/etc/gpib.conf, seems it changed location...
 

Offline picburner

  • Frequent Contributor
  • **
  • Posts: 500
  • Country: it
I also tried using the new linux-gpib 4.2.0 version with a pi3.
While with the old 4.1.0 I had no problems whatsoever with ni_gpib_usb_hs and with agilent 82357b,
with the new 4.2.0 I managed to make ni_gpib_hs work only and in root mode only (with 4.1.0 I had solved this with the
command "sudo usermod -a -G gpib pi" but it doesn't work anymore with 4.2.0).
Agilent 82357b doesn't seem to load the firmware with 4.2.0.
In practice I'm back to the good old 4.1.0 , it works!

P.S. Yes, the new location for gpib.conf is /usr/local/etc/gpib.conf
 

Offline Zigzar

  • Newbie
  • Posts: 8
  • Country: gb
Yes, the config file has moved!

After  editing the config file to the below, the ready LED is lit Green and it appears we're ready to go!

Code: [Select]
/***********************************************************************
                 GPIB.CONF IEEE488 library config file
                             -------------------

   copyright            : (C) 2002 by Frank Mori Hess
                          (C) 1994 by C.Schroeter
   email                : fmhess@users.sourceforge.net
 ***************************************************************************/
/***************************************************************************
 *   
 *   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, agilent_82357a or ni_usb_b for NI USB-GPIB-HS */
        name = "agilent"               /* optional name, allows you to get a board descriptor using ibfind() */
        pad = 0                       /* primary address of interface             */
        sad = 0                       /* secondary address of interface           */
        timeout = T100s               /* timeout for commands, 100s for slow stuff like DMMs with filtering on */

/* 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)      */

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

/* 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 = "VNA"   /* device mnemonic */
        pad = 16                        /* The Primary Address */
        sad = 0                 /* Secondary Address */
        eos = 0xa               /* EOS Byte, 0xa is newline and 0xd is carriage return */
        set-reos = yes          /* Terminate read if EOS */
        set-bin = yes           /* Compare EOS 8-bit */
        set-xeos = no           /* Assert EOI whenever EOS byte is sent */
        set-eot = yes           /* Assert EOI with last byte on writes */
}

However, running Ibtest and trying to write a string, throws up this error:
Code: [Select]
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]: 0
trying to open pad = 0 on /dev/gpib0 ...
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
send group e(x)ecute trigger (device only)
: w
enter a string to send to your device: *IDN?
sending string: *IDN?

gpib status is:
ibsta = 0xc100  < ERR TIMO CMPL >
iberr= 6
EABO 6: Operation aborted

ibcntl = 0

As always, thank you all for the help!
 

Offline picburner

  • Frequent Contributor
  • **
  • Posts: 500
  • Country: it
EABO indicates that an I/O operation has been cancelled for some reason, like a timeout.
Are you using ibtest in super user mode or as simple user?
 

Offline Zigzar

  • Newbie
  • Posts: 8
  • Country: gb
Yes, I believe so:

Code: [Select]
root@raspberrypi:/home/pi/linux-gpib/gpib_firmware-2008-08-10/agilent_82357a# 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]: 0
trying to open pad = 0 on /dev/gpib0 ...
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
send group e(x)ecute trigger (device only)
: w
enter a string to send to your device: *IDN?
sending string: *IDN?

gpib status is:
ibsta = 0xc100  < ERR TIMO CMPL >
iberr= 6
EABO 6: Operation aborted

ibcntl = 0

Thanks,
Zigzar
 

Offline Zigzar

  • Newbie
  • Posts: 8
  • Country: gb
Dear All!

Turns out I needed to use gpib address 6!

Code: [Select]
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]: 6
trying to open pad = 6 on /dev/gpib0 ...
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
send group e(x)ecute trigger (device only)
: w
enter a string to send to your device: *IDN?
sending string: *IDN?

gpib status is:
ibsta = 0x2100  < END CMPL >
iberr= 0

ibcntl = 6
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
send group e(x)ecute trigger (device only)
: r
enter maximum number of bytes to read [1024]: 1024
trying to read 1024 bytes from device...
received string: 'HEWLETT PACKARD,8703A,0,1.00
'
Number of bytes read: 29
gpib status is:
ibsta = 0x2100  < END CMPL >
iberr= 0

ibcntl = 29


Thank you all, I certainly owe you all a pint at some point in the future.
 

Offline MiDi

  • Frequent Contributor
  • **
  • Posts: 600
  • Country: ua
As I and others had quite some trouble to get the current gpib version 4.2.0 (r1771) to run on raspi with the Agilent adapter, I decided to put together a guide.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf