Package: beadpull
DescriptionThis is a measurement software for particle acceleration structures using bead pulling method.
It utilizesPyVISAdevice communication library as an intermediate device communication layer in order to support multiple platforms.
Device specific code is isolated in driver objects; adding new device driver is a matter of implementing a set of object methods.This program includes drivers for motors:Fake motor (placeholder driver)Randomly failing software motor (for program debugging)UIRobot motor driverThis program includes drivers for vector analyzers:Fake analyzer (placeholder driver)Randomly failing software analyzer (for program debugging)Agilent8753etInstallationGet python and pipDownload and install python and pip.You may use a package manager for this. For example, in Debian installation command looks like this:sudo apt-get install python3 python3-pipIf you don't have a package manager, download installer from thepython web site.You will need to install eitherNIdrivers (for Windows installations) orLinux-GPIBdrivers.InstallNIdriversIf you need to useNIdrivers, usethis manualfor installation.InstallLinux-GPIBdriversIn order to useLinux-GPIBdrivers, one must compile them and install python bindings.Note. Drivers are build for currentLinuxkernel. So, after kernel update one needs to recompile GPIB drivers.Getting sourcesIn order to proceed, you will need to install additional programs:aptinstall-ygitgit-svnGetting the latest sources:gitsvnclone-rHEADhttps://svn.code.sf.net/p/linux-gpib/code/trunklinux-gpib-codeNow you have the latest sources ofLinux-GPIB:cdlinux-gpib-codeCompiling driversFor driver compilation you will need Linux sources:sudoaptinstalllinux-sourcecdlinux-gpib-kernelIssue following command to start compilation:makeAnd then:makeinstallThat's it for driver compilation. Return one folder back.cd..Compiling userspace utilitiescdlinux-gpib-userSince we use source from project repo, we need to prepareautotoolsinstallation scripts:aptinstallautotools-dev
./bootstrap
./configure--sysconfdir=/etc
make
makeinstallInstalling Python3 bindingsGo to python bindings folder:cdlanguage/pythonCreating and installing Python3 module:python3setup.pysdist
pip3installdist/*.tar.gzConfiguring GPIB deviceDownload GPIB board firmware formhttps://linux-gpib.sourceforge.io/firmware/.Later in this documentagilent_82350adevice will be used.
Firmware archive is assumed to be located in~/Downloads/folder.Configure your board in/etc/gpib.conf. Consultconfiguration manual.
Configuration will look something like this:interface {minor=0       /* board index, minor = 0 uses /dev/gpib0, minor = 1 uses /dev/gpib1, etc. */board_type="agilent_82350b"   /* type of interface board being used */name="violet" /* 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)      */}device {minor=0       /* minor number for interface board this device is connected to */name="analyzer"       /* device mnemonic */pad=7 /* The Primary Address */sad=0 /* Secondary Address */timeout=T3seos=0xa       /* EOS Byte */set-reos=no /* Terminate read if EOS */set-bin=no /* Compare EOS 8-bit */}Upload board firmware, if necessary:sudogpib_config--init-data~/Downloads/gpib_firmware-2008-08-10/hp_82350a/agilent_82350a.binConfigure udev rulesSome boards require firmware upload on every start.
Also, superuser privileges are required for communication with device.
In order to remove these problems, lets add udev rule for device.Firstly, lets create new group, which will be able to use GPIB devices:addgroupgpibCopy your device's firmware to/usr/local/sbin.
Command will look something like this:cpDownloads/gpib_firmware-2008-08-10/hp_82350a/agilent_82350a.bin/usr/local/sbin/Then, create a file/usr/local/sbin/load_agilentwith contents:#!/bin/bashgpib_config--init-data/usr/local/sbin/agilent_82350a.binAnd allow its execution:chmod755/usr/local/sbin/load_agilentAdd the following line to the/etc/udev/rules.d/99-gpib.rulesfile:KERNEL=="gpib0", SUBSYSTEM=="gpib_common", GROUP="gpib", MODE="0660", RUN+="/usr/local/sbin/load_agilent"Now device will be available for users in groupgpib, its firmware will be automatically loaded.InstallBeadPullFrom the terminal issue the commandpip3 install beadpullfor system-wide installation, orpip3 install --user beadpullfor the local installation.Add user to device communication groups [Optional]Gnu/Linuxdistributions restrict access to peripheral devices.To grant access to serial devices to user, issue command:adduser user dialoutUSB devices:adduser user plugdevGPIB devices (if configured):adduser user gpibRunIn order to run the program, from the terminal issue the commandbeadpullIf it's not found, you have to modify thePATHenvironment variable to include the python scripts folder (unix guide,windows guide) or supply the full path to the program.OtherUpdatebeadpullTo update program, from the terminal issue the commandpip3 install --upgrade beadpullfor system-wide installation, orpip3 install --upgrade --user beadpullfor the local installation.Resetbeadpullsettings to defaultsProgram saves its settings underAPPDATA/beadupllon Windows and$XDG_CONFIG_HOME/beadpullor$HOME/.config/beadpullon other systems.
In order to reset settings, simply delete saved settings folder.Issue submissionIn case of a problem with the program, create an issue in theissue tracker.