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" /* optional name, allows you to get a board descriptor using ibfind() */ pad = 0 /* primary address of interface */ sad = 0 /* secondary address of interface */ master = yes /* interface board is system controller */ timeout = TNONE /* timeout for commands */ } device { minor = 0 name = "ATTN" pad = 0 sad = 0 }
#!/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= # 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
# usb module match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterface Protocol driver_info agilent_82357a 0x0003 0x0957 0x0007 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 #agilent 82357b agilent_82357a 0x0003 0x0957 0x0518 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Generate a 1kHz, 1V square wave. f = HP_3325A( address['HP_3325A'], 0 ) f.set_print_gpib(0) f.set_print_error(0) f.set_function( 'square' ) f.set_frequency( 1, 'kHz' ) f.set_amplitude( 1, 'v_rms' ) # Get the signal's spectrum s = HP_3582A( address['HP_3582A'], 0 ) s.set_print_gpib(0) s.set_print_error(0) s.set_input_mode( 'cha' ) s.set_sensitivity( 'cha', 3 ) s.start_measurement( 'rms', 5, 1 ) (frq,cha,chb,samps,aok,bok) = s.get_spectrum() # Plot it. ann = s.read_annotation() ch1ann = s.parse_channel_annotation(ann,'cha') ch2ann = s.parse_channel_annotation(ann,'chb') avann = s.parse_average_annotation(ann) bwann = s.parse_bandwidth_annotation(ann) plt.plot(frq[0:samps-1],cha[0:samps-1]) plt.title( 'HP 3582A Spectrum Analyzer' ) plt.xlabel( 'Frequency (Hz)' ) plt.ylabel( 'Amplitude (dBV)' ) plt.grid( True ) ax = plt.gca() plt.text( 0.6, 0.90, ch1ann, transform=ax.transAxes ) plt.text( 0.6, 0.85, ch2ann, transform=ax.transAxes ) plt.text( 0.6, 0.80, avann, transform=ax.transAxes ) plt.text( 0.6, 0.75, bwann, transform=ax.transAxes ) plt.show()
#!/bin/bash echo "Fetch new gpib-modules-dkms for Ubuntu 14.04 and upgrade." # # Vsevelod Kukol no longer maintains Ubuntu GPIB. He stopped at V13. # Fortunately, Phil Pemberton has taken up the gauntlet. # This script gets the updated kernel modules from his PPA # and installs them # sudo add-apt-repository ppa:philpem/ppa sudo apt-get update echo "The next step will take ome time." echo "It removes all previous GPIB kernel modules from all the Ubuntu" echo "kernel versions that have ever been installed. Which will be lots." echo "Please just let it run." sudo apt-get install gpib-modules-dkms echo "Done. Try plugging in the Agilent 82357A. It should load firmware" echo "and work as it did on 12.04 LTS."After this, everything works again. YMMV!