You are on page 1of 2

How to use GPIB-linux on Ubuntu: It is actually quite doable to get GPIB-linux to work with Ubuntu.

I've been usi ng Debian as my instrumentation controller for a little over a year and just swi tched over to ubuntu 10.10, ubuntu would have been my first choice, but the old version of linux-gpib was incompatible with the 2.6.x x>24 kernels so I had to g o with debian. Now that gpib-linux has been successfully patched for the new ker nels i'm migrating over to ubuntu (its a lab computer so ubuntu is much friendli er as a general desktop OS) The packages that you need to install are gpib-modules-source (module sources) a nd libgpib-bin (binary utilities). gpib-modules-source will also install all the build utilities and dependencies if you don't have them already (and the kernel headers). You can try to use the module-assistant to build the kernel modules, but this fa iled for me for whatever reason, instead I just downloaded the gpib-modules-sour ce tarball from sourceforge. What follows is the standard unpack-configure-build-install procedure that you m ust go through when installing from source (if you need me to elaborate on this please ask). The install script should place everything in the right locations a nd setup up the new gpib group - I'm running a vanilla x86 10.10 install and the build completed without any issues. First step after installing the kernel modules is to test that everything instal led as planned. You can either reboot, or load the proper kernel module by hand (board model -> driver module name chart is located here ). Run Code: sudo gpib_config followed by Code: sudo ibtest (we are using sudo because we haven't set permissions for the gpib device node y et). ibtest should give you a prompt asking you for wheather you want to open a device or a board (device), then it will ask you for the GPIB address of the dev ice. Write a string (w) to the device - *IDN? is a good one because its universa l and spits back the name of the device, get the response to the query by asking ibtest to read (r) 100 characters or so. If the above test worked then you are ready to setup permissions. Create a new f ile in /etc/udev/rules.d named 70-gpib.rules or something similiar (the number i n front doesnt really matter, it only determines which rules will be set first) and add the following line Code: KERNEL="gpib[0-9]*", MODE="0660", GROUP="gpib"

then proceed to add yourself and any other users to the gpib group. Once this is done you can install python-gpib (python bindings for the library), you can also edit /etc/gpib.conf to address your devices by name (rather than l ooking up their id's every time) - this is necessary for python-gpib (when you i nstantiate a device it wants a name and not a address). You should read in the d ocumentation on how to do this properly. (Look at the examples in the conf).

You should reboot after setting the udev rules (or change the permissions by han d for this session if you don't want to restart yet), restarting udev didn't see m to do the trick.

You might also like