Gpib

Get the latest tarball from

http://sourceforge.net/projects/linux-gpib/

To install the software :
1. Extract the tarball to a temp-folder and follow the INSTALL file instructions
2. Install the debian kernel header and kernel sources matching the actual used version
3. Then ./configure, make and make install (as root)
4. Add the gpib-libs to the system-path by creating a file "/etc/ld.so.conf.d/gpib_lib.conf" with the following single-line content: /lib/modules/3.2.0-4-amd64/gpib
5. Update the library database with "ldconfig"
6. Add the user to the group "gpib" by usermod -a -G gpib username

Setting up the gpib-interface (e.g. agilent_82357b)
1. The interface-name for the Agilent 82357b is "agilent_82357a" (see list of supported devices http://linux-gpib.sourceforge.net/doc_html/x259.html)
2. Edit the file "/etc/gpib.conf". This connects "GPIB0" to the "agilent82357b" and it declares the measurement-device "Keithley 2700" to have the GPIB adress 16.

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 = "gpib0"      /* 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 */
        master = yes    /* interface board is system controller */
}

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

Before continuing with the communication, the Agilent 82357b requires a firmware-update.
1. Manual Update
1. Get the firmware-update from the linuxgpib-website (http://linux-gpib.sourceforge.net/firmware/)
2. Extract to temp-directoy and go into the "agilent_82357a" folder
3. Follow the "README" instructions (note: for agilent_82357b the firmware needs to be loaded 2 times due to a bug)
4. List USB devices via "lsusb":

Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 045e:0040 Microsoft Corp. Wheel Mouse Optical
Bus 002 Device 017: ID 0957:0518 Agilent Technologies, Inc. 82357B GPIB Interface

5. Upload the firmware to the 82357b via "fxload -v -t fx2 -D /dev/bus/usb/002/017 -I measat_releaseX1.8.hex"
6. List USB devices via "lsusb":

Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 045e:0040 Microsoft Corp. Wheel Mouse Optical
Bus 002 Device 018: ID 0957:0518 Agilent Technologies, Inc. 82357B GPIB Interface

7. The 82357b got a new USB-adress but its ID is still "0957:518". A second firmware-upload is necessary to achieve "0957:0718".
8. Upload the firmware to the 82357b a second time via "fxload -v -t fx2 -D /dev/bus/usb/002/018 -I measat_releaseX1.8.hex"
10. List USB devices via "lsusb":

Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 045e:0040 Microsoft Corp. Wheel Mouse Optical
Bus 002 Device 019: ID 0957:0718 Agilent Technologies, Inc. 82357B GPIB Interface

11. Now the firmware has been updated manually.

1. Automatic Plug-In Update via udev
1. Copy the firmware-folder "agilent_82357a" from the temp-folder" to "/lib/firmware"
2. Copied the file "agilent_82357a" from "/etc/hotplug/usb" to "/lib/udev"
3. Modify the file "/lib/udev/agilent82357a" as follows:
- Update the "DATADIR" variable as DATA_DIR=/lib/firmware
- Change all the occurrences of "$DATADIR/usb/" to "$DATADIR/"
- Changed the last line to "$FXLOAD $FXLOAD_OPTIONS -D ${DEVNAME} -I $FIRMWARE"

4) Edit/Create the file "/etc/udev/rules.d/70-gpib.rules" as:
ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="0957", ATTR{idProduct}=="0518", MODE="660", G$
ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="0957", ATTR{idProduct}=="0518", RUN+="/lib/ud$
## Note that :0518 becomes :0718 after firmware is loaded
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0957",ATTR{idProduct}=="0718", RUN+="/usr/local/sbin/gpib_config"
KERNEL=="gpib[0-9]*", MODE="0660", GROUP="gpib"

Testing the GPIB interface and device
1. Run "gpib_config". If no output is given, the interface is up and running (the 82357b Ready-LED shall be green)
2. Run "ibtest" and select "b" for board, enter as name "gpib0" (as given in /etc/gpib.conf) and play with the commands
3. Run "ibtest" and select "d" for device, enter "16" for the deviceadress and play with the commands

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License