I initially had some problems installing on my laptop, so decided to boot Ubuntu 12.04.5 LTS, 3.13.0-32-generic from USB and work from there.
For an automated installation script, see gpib_install.sh (and gpib.conf) below. The rest of this document describes the actions of the installation script step-by-step.
First, get the packages that are necessary to support Python bindings:
sudo apt-get update sudo apt-get install python-dev libboost-python-dev python-setuptools --yes
Download the linux-gpib package, unpack and build:
wget --content-disposition --no-check-certificate https://sourceforge.net/projects/linux-gpib/files/linux-gpib%20for%203.x.x%20and%202.6.x%20kernels/3.2.20/linux-gpib-3.2.20.tar.gz/download tar xvfz linux-gpib-3.2.20.tar.gz cd linux-gpib-3.2.20 ./configure make -j8 sudo make install cd ..
Also download the firmware binary for the 82357B:
wget --content-disposition --no-check-certificate http://linux-gpib.sourceforge.net/firmware/gpib_firmware-2008-08-10.tar.gz tar xvfz gpib_firmware-2008-08-10.tar.gz
fxload is used to upload firmware to the GPIB interface.
wget --content-disposition --no-check-certificate https://downloads.sourceforge.net/project/linux-hotplug/fxload/2008_10_13/fxload-2008_10_13.tar.gz tar xvfz fxload-2008_10_13.tar.gz cd fxload-2008_10_13 make sudo make install cd ..
Edit /etc/gpib.conf
(as superuser) to fill in the correct board type:
interface { board_type = "agilent_82357a" name = "agi" ... }
See the attached gpib.conf for the full contents of the file (other parameters were left at their default values).
Load kernel module(s):
sudo modprobe gpib_common sudo modprobe agilent_82357a
Insert the dongle into the USB port. Only the red "FAIL" LED should be on. Find the bus and device ID:
lsusb
e.g.
... Bus 002 Device 005: ID 0957:0518 Agilent Technologies, Inc. ...
Plug the found bus and device ID into the command for fxload:
sudo fxload -D /dev/bus/usb/002/005 -t fx2 -I gpib_firmware-2008-08-10/agilent_82357a/measat_releaseX1.8.hex
Still only the "FAIL" LED is on.
The USB bus and device ID have now changed. Wait a moment and get the new ID:
lsusb
e.g.
... Bus 002 Device 006: ID 0957:0518 Agilent Technologies, Inc. ...
Run fxload again with the new bus and device ID:
sudo fxload -D /dev/bus/usb/002/006 -t fx2 -I gpib_firmware-2008-08-10/agilent_82357a/measat_releaseX1.8.hex
All lights should be on.
Change permissions on /dev/gpib0
(ideally, you would manage this with a "gpib" usergroup instead):
sudo chmod 666 /dev/gpib0
Now, initialize the dongle. gpib_config
has some trouble finding the library, so create a symbolic link first:
sudo ln -s /usr/local/lib/libgpib.so.0 /lib/libgpib.so.0 sudo gpib_config
Only the green "READY" LED should now be on.
Now, make an entry for your device in /etc/gpib.conf
. Default HP3456B factory address is ASCII "V" (22 dec) for talk and "6" for listen.
device { name = "hp3456a" pad = 22 ... }
You can use ibtest
to do some testing.
ibtest
A simple Python interface can now be made using the linux-gpib Python bindings:
import gpib dev = gpib.find("hp3456a") # corresponds to device ID in ``/etc/gpib.conf`` print gpib.read(dev, 99)
For more advanced applications, consider using the visa (PyVISA) libraries.
[pyvisa] | PyVISA https://pyvisa.readthedocs.io/en/stable/ |
[linux-gpib] | linux-gpib : http://linux-gpib.sourceforge.net/ |
Hello. This was very useful. However, after following these instructions when I run the simple script:
I get this error
Could you give me some insight as to why this could be happening? Thank you.