Notice: Undefined index: pass123 in /var/www/html/getsimple/theme/FrixelOne/template.php on line 8 Controlling Instruments via GPIB - KO4BB

Manuals, Timing, Ham Radio, Test Equipment

Help keep this site free:
(More Info)

Controlling Instruments via GPIB

I started a collection of HP, Tek and Fluke test equipment a few years ago. Pretty soon, the desire to do something with the GPIB (also called IEEE-488) connector on the back of most of these instruments drove me to action.

Some of the applications of computer control include: plotting the frequency response/insertion loss of filters or other devices, and logging data at specified time intervals for instance.

Plotting is done using a signal generator and a power meter, for instance. The computer sets the generator to a specific frequency, then measures power, then the frequency is increased and the process repeated until the desired frequency band is covered. During the process, the data is stored to a file. Another program can be used to display the data. That could be a simple spreadsheet program such as Microsoft Excel, or a custom plotting program.

Logging usually involves a single instrument, such as a voltmeter, a frequency counter or a thermometer for instance, and data is collected at specified time intervals.

The first step will be to get the data in and out of the instrument, and that will require a GPIB controller of some sort.

GPIB, HPIB, IEEE-488 refer to the same interface, originally developed by Hewlett-Packard for their test instruments, and later officially released by the IEEE as IEEE-488. In the mean time, as the bus became well known and customers were asking for it from HP's competitors, other companies used the acronym GPIB so that they could refer to it without endorsing HP...

In this page, I will use the term GPIB because it is probably the best known. It seems that the GPIB interface will eventually go away, being replaced in newer equipment by ethernet and/or USB ports, which have much greater data rate capability, even though the GPIB bus has the advantage of being able to simultaneously trigger multiple instruments, something that can be approximated, but not yet replicated, by the other topologies.

GPIB Controllers

There are 3 basic types that I am familiar with.

  1. The plug-in card type, with the older AT style plug-in card being fairly cheap on eBay ($5 to $10 for most), but not many computers have suitable slots, or the more recent PCI type, which are still relatively expensive on eBay ($100 to $200).
    The big advantage of plug-in type of GPIB controller is that they are likely to be supported by the widest range of software packages. Make sure you have the drivers for your card, but if you don't, not all is lost as there are not that many types of interface chips, and you are likely to find a compatible driver on the Internet.
    One problem with the plug-in cards is that you will need the computer fairly close to the equipment because GPIB signals don't travel too far, and the cables are bulky and expensive when new (see below). You will also spend quality time becoming friendly with the back of your computer :-) Of course, if you use a laptop, you are out of luck with an AT or PCI controller.

    PCI GPIB Controller Card

  2. The USB type, with the Prologix (Ref 1) controller being one of the least expensive "new" USB controller you can buy ($150), and considerably more expensive models from National Instrument (Ref 2) (NI) or Measurement Computing (Ref 3) (MCC) at about $500 to $600.

    Prologix USB GPIB Controller

    Used USB controllers from NI or MCC go for about $300 to $400 on eBay.

    USB controllers can operate farther from the computer, and USB controllers don't require a separate power supply (at least those listed here).

    Besides being reasonably priced, the Prologix controller is supported by 3rd party software and can be used via the serial emulation driver that you can download from FTDI (Ref 10) Info comes with the board and is also on the Prologix FAQ (Ref 1). It works with John Miles' software (Ref 4), and hopefully soon with my own software (I am currently evaluating the most recent controller, with firmware 4.20).

    A neat feature of the USB controllers is that they can be plugged directly to the back of the instrument, so you save the GPIB cable, but you need sufficient clearance in the back of the unit. Otherwise, you can make a short ribbon cable (see below). USB controllers also work well with laptops.

    An Australian company, Softmark (Ref 5) sells another type of USB controller for a low price. The controller is provided with software that appears to have the capability to query and record data from an instrument at a certain periodicity. I have seen this type of controller sell on eBay for as little as $35 recently, but I have no personal experience with it. I have not seen it supported by any other software package, so if you get one of those, either you use it with the software that is provided, or if it does not do what you want, roll your own. I have not seen these controllers used anywhere and I do not recommend them.

  3. The RS-232 type, with models from Black Box, IOTech, National Instruments and probably others. These can be bought fairly cheap on eBay, but you may have to wait a little while, as they are not very common. I have models from BlackBox and IOTech. I paid anywhere from $20 to $50 for those. In general, serial-GPIB controllers have non-standard protocols, so you must write software for the model you have. I would assume the NI model at least is supported by LabVIEW, but I do not know that for a fact.

    The BlackBox Controller is housed in a medium size enclosure and requires a 9-10V DC supply at 500 mA or so to operate. The unit has an internal three terminal linear voltage regulator generating the 5V used by most of the logic circuits. This regulator runs fairly warm with the max 10V input specified voltage. Since my units were overheating with the 12V I was feeding to them (I have a lot of 12V powered equipment in my lab), I replaced the linear regulator with a small switching regulator. My controllers now run cool with unregulated 12 to 15 VDC, and the current draw is down to 300mA or so.

    BlackBox Serial GPIB Controller

    Be careful that BlackBox sells two similar models, one is a true controller, that's the one you want, the other is an adapter and has limited functionality, and would be useless for your purpose (it is intended to drive plotters and such). The difference between the two is in the EPROM and the silk-screen on the front panel, the hardware is the same.

    The IOTech Micro488/p is much smaller and runs from power stolen from the serial port, pretty neat (however, it will not work if there are too many un powered instruments on the bus).

    IOTech Micro488/p Serial GPIB Controller

  4. The PCMCIA (or PCCard) type, for laptops. These are fairly rare and expensive. For all practical purposes, unless you stumbled onto one, if you use a laptop, you will be better off with a USB controller.

    PCMCIA GPIB Controller Card

  5. The Ethernet type, such as the NI ENET controller. These open up interesting possibilities, allowing to remotely control your equipment via the Internet or a local area network. With the right driver and when using LabVIEW, they operate transparently as if the card was plugged into the computer. I am not sure of the compatibility with other applications.

    Ethernet GPIB Controller Card

I like the serial controllers because they are inexpensive and don't require to go inside the computer. They can easily be swapped from one computer to another and work well with laptops, which cannot use an AT or PCI internal controller. Finally, serial controllers do not require low level drivers or special libraries when you write software for them (however they will require custom user level code in most cases).

Serial Controllers have a disadvantage for some applications: the data transfer rate is less than most other types, which is not a problem when controlling signal generators, or reading from a frequency counter, but may slow down the process of downloading a lot of data from a spectrum analyzer for instance. USB is quite a bit faster (even though the earlier Prologix internally used serial communication, the latest model pictured above uses a fast parallel interface) but the speed champs are the PCI types of controllers. AT controllers also will be faster than most other types, except for the NI and MCC USB controllers with their proprietary drivers.


GPIB Cables

If you want to control more than one instrument, or if you use a Serial or AT/PCI controller, you will need one or more GPIB cable(s).

Standard GPIB cables are designed with male/female connectors at each end, so they can be daisy-chained from instrument to instrument, and finally to the controller.

Commercial OEM GPIB cable


Industry standard GPIB cables are very stiff and expensive when new, but cheap (yet, still stiff...) when bought on eBay.

I have bought several cables on eBay, but I also make my own cables using ribbon cable and IDC connectors (Insulation Displacement Connector, also called "crimp connector") from Digikey (male connector is P/N: MDC24K-ND, female connector is P/N: MDF24K-ND, they cost about $5.50). It's not much cheaper than true GPIB cables from eBay (if you only control one instrument), but much easier to daisy-chain from instrument to instrument, and definitely cheaper if you have many instruments.

Home made GPIB cable


If you make your own cable, don't forget to buy at least one female connector, even if you don't think you need one for your cable. Unless you have the official crimp tool (quite expensive), you will need one to crimp the male connectors to the cable without damage using a small vise. On the other hand, putting a female connector at one end of the cable will allow you to add an extension later, and if you use one of the Prologix, Softmark, MCC or NI USB-GPIB controllers, you can plug it here to control multiple instruments.


GPIB Software

Of course, you also need some software to get the data into the PC. Let's quickly pass over National Instrument's LabVIEW, which is very nice but definitely not priced for the hobby market at $1,200.00 for the base version (even older versions on eBay sell for more than most GPIB controllers). I doubt that LabVIEW supports inexpensive controllers such as the Prologix or the Softmark USB-GPIB controllers.

If you are only interested in getting data out of an instrument such as a scope or a spectrum analyzer, John Miles has written a very nice, free HP 7470 Plotter Emulator

Another option if you want to download data from a Tek digital storage scope is Tektronix Wavestar, a commercial application made by Tek. As of 12-16-06, the cost from Tektronix was $330.00. You can download a free, 30 days product evaluation copy from the Tektronix web site. I am not sure which adapters are supported. It's likely the Prologix and Softmark are not on the list. The Tek Wavestar software also supports serial interface, for the Tektronix instruments that have this interface. It does not support serial GPIB controllers from NI, IOTech or Black Box. If you have a Tek scope with a serial port, this is an easy (if not cheap) way to get data from the scope into the computer.

If you want to control instruments such as signal generators, you can try a free program called EZGPIB by Ulrich Bangert. It includes a Pascal scripting engine which may allow you to do what you want without having to buy a Visual Studio development system or some other compiler.
While you won't need a compiler, you will still be required to write code for the scripting engine. There may be other such free software, but I have not come across any. I am not sure which GPIB controllers are supported other than the Prologix. Ulrich has also written another piece of software called Plotter, which is a very useful tool to display data in graphical format and can be used for timing analysis.

I have started working on GPIB Control software to take advantage of the GPIB ports on my instruments, and while not quite ready for prime time, it is usable (at least for me). For now, this software only supports the BlackBox and IOTech RS-232-GPIB controllers, but I am working on the Prologix controller. This software supports a number of instruments (right now, HP 8656A, HP 8657B, HP 3478A, HP 5316B, HP 5334B, HP 5370A, HP 8672A, HP 8673M, HP83640, HP 3586A, Fluke 8860, HP 59306A, HP 59307A, HP 436A, HP 437B) with more coming. Functions that are supported are of two types: Plotting (such as sweeping the frequency of a signal generator and measuring power with the HP 436A or the HP 3586A for instance) and Logging, where data from a voltmeter, HP 3586 or counter is collected at a given periodicity (from a fraction of second, when practical, to many minutes). The program supports the equipment listed above. Logging can also automatically scan the HP 59306A or HP 59307A switches to log multiple channels with a single instrument. I believe it would be simple to add other instruments once I look at the commands.

The next picture is a plot from my Tektronix 494P spectrum analyzer using John Miles' excellent 7470 Emulator program (part of his GPIB Toolkit) and the Prologix USB Controller, showing the frequency response of a Drake low pass filter. The filter was driven by a noise source and the spectrum analyzer shows the signal at the output of the filter. The attenuation at the left part of the plot is very low, about 1dB. The attenuation at the high end (>600MHz) cannot be measured, what you see is the noise floor of the spectrum analyzer. To show the attenuation with better sensitivity, I should have used the signal generator, but the noise source is a very quick way to check filters using the spectrum analyzer, if you can live with the limited sensitivity. The hump between 80 and 100 MHz is real though.

My program will be placed on this site when it's close enough to be usable by people who don't want to or can't fire up Visual Basic as soon as something unexpected happens...

For information on computer languages that can be used to control equipment via GPIB, check Brooke Clarke's page (Ref 11).