If you built and installed the
Linux-GPIB drivers, then there will be some sample code there. The
ibtest utility that is part of the package is very useful for making sure that you've got the driver correctly loaded and installed. It allows you to interactively send commands to devices attached to the bus, as well as configure the bus itself. I have used the source code for that as a model for some basic test and development code in some projects. There is other source code samples in the '
language/' tree of the driver package.
There is a tool,
ibconfig, that must be run before you can use the loaded driver. After that, everything should work.I usually put the
ibconfig step into
/etc/rc.local so it runs at boot time. You may have to also modify the permission levels on the device node(s)
/dev/gpip* in order to access the bus. The only problem I've ever had with the package is that some of the drivers don't always build for all kernel versions, but the NI board drivers have always built and worked fine. If you run into that, then comment out the recalcitrant ones in the appropriate Makefile, so the build completes successfully.
One aspect that may warrant further clarification is the use of the
gpib.conf file that is used by
ibconfig. In there, you can created named devices that are associated with particular GPIB bus addresses and with some GPIB configuration parameters like time-outs, etc. These are only necessary if your code uses the API functions that need these named devices. There is a whole class of name-agnostic functions which rely only on device names (/dev/gpibX) and GPIB addresses. I tend to prefer these over the fucntions that use the named devices set up in the config file (not saying there is anything wrong with the others; just haven't used them much). I think the sample code tends to use the API functions that do use the named devices.
If you have a NI GPIB interface, it probably came with some DOS-ish software and libraries. The documentation for those libraries is also a useful guide, as the
Linux-GPIB package models the API after NI's version, and seems to be a pretty faithful rendition of the NI software.
The software does work well. I've got a dozen or so installations that run 24/7 controlling a variety of T&M gear, all problem free, and some that has been doing so for over ten years. I have been using Scientific Linux (4,5, & 6), and more recently a Debian-6 based package for both building the software and running applications. I only today became aware of the
gpib-utils package, so I cannot offer any comment on that product.
--- rod.