|
Home Up Updates Current Products Prior Products - no longer available Documents Book Software Updates Softrock Lite 6.2 Adventures in Electronics and Radio Elecraft K2 and K3 Transceivers
| |
|
EZGPIB and Prologix GPIB Adapter
Revision History
Original 24 October 2008
25 Oct 2008 - cleaned up formatting problems
|
|
Much of the measurement data presented in my web pages is
collected with computer control of test equipment. I thought it time to go
into some detail on the arrangements I use. Almost
all Hewlett Packard (now Agilent) test equipment designed in the last 30 years
includes a remote digital control interface, purely analog equipment excepted,
of course. Originally known as the "HPIB" or Hewlett Packard Instrument Bus, it
became an IEEE standard in the mid 1970's, the "IEEE-488" interface. It's also
known as the GP IB or
general purpose interface bus. Although developed by HP, it's widely used by
other manufacturers, including Tektronix, Racal and virtually all other test
equipment producers.
Instruments equipped with GPIB have the 24 position female
connector pictured above. Multiple instruments may be parallel connected using
GPIB connecting cables,
such as the one shown
at the right. Each end of the cable has a male and female GPIB connector making
it easy to connect multiple instruments. Purchased new, GPIB cables are quite
expensive, but they are readily available surplus. I prefer genuine HP cables as
they are better mechanically and electrically constructed than some "no name"
cables I've acquired.
In addition to the electrical specifications of the bus,
there's also commonality in command and response syntax amongst manufacturers. |
Let's break down control and data collection into two
pieces:
- How to connect a computer to GPIB equipped test
equipment ; and
- Programs to communicate with the computer.
|
Connecting a computer to GPIB equipped
test equipmentExcept for a few HP computers
with a built-in GPIB port,
made in the early
days of personal computing, connecting a PC to a GPIB instrument requires an
adapter of some sort. These h ave included plug-in cards for desktop
computers and PCMCIA-based cards for laptop machines, as well as RS-232 to
GPIB adpaters, USB-to-GPIB adapters and , more recently,
Ethernet-to-GPIB adapters.
In order to keep this discussion centered on what I
use, this discussion will focus on USB-to-GPIB and GPIB-to-Ethernet adapters
made by Prologix.
http://prologix.googlepages.com/
In particular, Prologix's GPIB-USB controller, model
4.2, pictured above right above and the GPIB-LAN Controller, model 1.0,
pictured at the right below. I own two GPIB-USB controllers and one GPIB-LAN
(Ethernet) controllers. I also have one of Prologix's first generation
GPIB-USB adapters, but won't further discuss it as it is no longer in
production.
The current price of the Controllers when ordered in
small quantities directly from Prologix is:
$149.95 for the GPIB-USB Controller
$199.95 for the GPIB-LAN Controller
A small shipping and handling charge is applied.
Other controllers exist, such as those from Agilent/HP
and, most notably, National Instruments. I have not used anything other than
Prologix controllers, so I'm not in a position to comment on them.
|
|
Prologix's model 4.2 Controller connects to a USB port on
your computer. It requires downloading and installing a driver from FTDI, the
manufacturer of the USB-to-serial chip used in the Controller. Once installed,
the Controller hooks to your software in one of two modes; either by appearing
as a virtual serial port (COM) or at a lower level via direct calls through the
FTDI-provided dynamic link library (DLL) code. In order to keep this page to a
manageable length, we'll look only at the virtual COM port connection.
Prologix's GPIB-LAN Controller has a standard RJ-45
Ethernet connector and plugs into your router, or wireless bridge or directly
into your computer. (If plugged directly into the computer, you may or may not
need a crossover cable, depending on the age of your PC. See the GPIB-LAN
operating manual for more information.) It also has a small wall-wart type power
supply. (The GPIB-USB controller takes its DC power fom either the USB interface
or the GPIB interface.) The GPIB-LAN Controller then appears as a device on your
network, with a unique IP address. For example, in my home network, I plug the
Controller into a wireless access point in the basement. I can then access the
controller from any computer on my network, whether linked by wireless or by
wired connection to my Linksys 802.11N router.
|
|
Software for Communicating and
Controlling the Instrument
Plots and Printed Output
Before considering computer control of a GPIB equipped
instrument, it's necessary to distinguish between "controller" and "device"
mode.
Many instruments, such as oscilloscopes, spectrum
analyzers and network analyzers have cathode ray tube displays (or LCD) and are
equipped to make a printed image of the display over the GPIB port.
Traditionally, the device connected to the GPIB port has been a mechanical
plotter, although newer instruments are also capable of sending a hard copy
image to ink-jet or laser printers over the GPIB port.
There is software available that allows a computer
connected via a Prologix Controller to emulate a plotter or a printer and
receive the transmitted data. The data is then rendered into a plot on the
computer screen and may be saved in various formats or printed. When operated in
this mode, the test instrument is the "network controller" and the Prologix card
is a "device."
I use two programs for this purpose:
- PrintCapture—is available at
http://www.printcapture.com/. A
free time-limited demonstration version can be downloaded, with the licensed
version costing $97.00.
- John Miles' GPIB Toolkit—is available at
http://www.ke5fx.com/gpib/readme.htm. This is freeware,
developed by John Miles, KE5FX, and includes a plotter emulation program,
7470.exe, as well as a configuration utility to simplify modifying
configuration files needed by 7470 to communicate with the particular GPIB
adapter you are using.
Both of these are excellent programs, although with some
important differences.
- PrintCapture emulates not only an HP plotter, but
also HP inkjet and laser printers using "PCL" (page control language) and
Epson dot matrix printers. This provides more inter-operability options than
7470.exe, which only emulates the Hewlett Packard 7470 plotter.
- From my experience, every instrument that can output
to a hard copy device will work with an HP plotter but the resulting image
quality and features may be subtlety different, with output to a PCL printer
providing better quality on some of my test gear.
- There are some quirks in how HP and other companies
implemented their plotter output functions, so that some gear I own works
with 7470.exe but not with PrintCapture. For example, an Advantest R3463
spectrum analyzer works with 7470.exe but will not produce a usable image
with PrintCapture. On the other hand, my HP 87510A network analyzer will not
successfully write a plot to 7470.exe but will to PrintCapture.
- 7470.exe supports Prologix's GPIB-LAN controller, but
PrintCapture does not. (Both support Prologix's GPIB-USB controller.)
- PrintCapture is a more polished, commercial program
that's easier to setup and to use. 7470.exe has a certain "tekkie" quality
to it and can require more tinkering with files and options than
PrintCapture. To take one simple example. To change pen color in 7470.exe
requires editing the programs INI file with a text editor. PrintCapture has
a drop down menu and dialog box that lets you set the color associated with
each particular pen. The dialog box displays the color options associated
with each pen color and lets you define a new color association using drop
down lists. (You can save the configuration, of course.)
- 7470 allows the user to annotate the image
directly, whilst PrintCapture does not. (It's possible to save a
PrintCapture image and then add an annotation with a program such as
Irfanview, of course.)
I find myself using both programs about equally. I should
also mention that both PrintCapture and 7470.exe support GPIB adapters other
than Prologix.
I've had exchanges of E-mail with both developers and
found them responsive to my questions and suggestions. Mike Shride,
PrintCapture's developer, for example, modified PrintCapture to work with my
HP87510A vector network analyzer, which has some relatively uncommon responses
expected from the connected plotter. John, KE5FX, has implemented several
of my suggestions in recent versions of 7470.exe.
The images below illustrate how PrintCapture and 7470.exe
render plots.
|
|
PrintCapture - PCL (Inkjet Emulation) Mode - HP8753B VNA
 |
7470.EXE Rendering of a HPGL file saved to disk by HP87510A VNA
 |
|
7470.EXE - Direct Emulation of Plotter - HP8753B VNA
 |
|
Controlling the Instrument
In many cases, simply obtaining a plot capture from an
instrument over the GPIB port is all that's required; however it only scratches
the surface on the possibility raised by computer controlled test equipment.
A few specialized control programs exist. For example,
John Miles's GPIB Toolkit includes programs to display and calculate phase noise
using a variety of spectrum analyzers and to display a waterfall-type image from
various spectrum analyzers. However, the main focus here should be upon
user-written programs to command test equipment.
The image below, for example, was generated using John's GPIB Toolkit program
SSM, demonstrating the waterfall spectrum display in the top image and the
normal spectrum display below. |
 |
|
|
|
Examples of what one might do with custom programming of computer controlled
test gear can be seen in the following pages at my site:
Until the last week, I've written all the control programs
in Liberty Basic, an inexpensive Windows-based BASIC compiler. (Well, it's
probably more accurately described as a BASIC interpreter, rather than a pure
compiler.) I find the editor provided with Liberty Basic not quite as good as it
might be, so I've also purchased an optional editor program, Liberty Basic
Workshop. The total outlay for both programs is under $100.
For more information:
To use Liberty Basic with a Prologix GPIB-USB adapter,
treat it as a virtual serial port, COM device.
However, I've decided that the freeware program EZGPIB, by
Ulrich Bangert, DF6JB, is better in many instances. You can download EZGPIB and
the associated manual at
http://www.ulrich-bangert.de/html/downloads.html
EZGPIB is an extended version of Pascal, with built-in
support for Prologix (and some other) GPIB controllers. In particular, Ulrich
has written EZGPIB so that the user can concentrate on program flow and data
analysis, rather than having to worry about the nuts and bolts of handling
communications flow between the program and the instrument. He has accomplished
this through a library of special purpose functions and procedures (each
prefixed with EZGPIB) such as:
EZGPIB_buswritedata(address, string);
The procedure EZGPIB_buswritedata sends a string to the
instrument at a particular address connected to the GPIB adapter. Similar
library routines read data from the instrument and handle disk file read and
write operations, and user output.
I particularly like EZGPIB's automatic detection
feature—it scans your computer and detects any Prologix (or other supported GPIB
adapters) and connects to them. This includes the new Prologix GPIB-LAN
Controller as well as Prologix's GPIB-USB controller. Since the connection
scan process is invisible to the user, code written for the USB-based controller
runs on the LAN-based controller without change. That's a great feature.
I've written a lot of Pascal code over the last 25 years
and consequently had little trouble getting up to speed with EZGPIB. Ulrich's
extensions are to the run time library of Delphi, so anyone that has programmed
with Borland's Pascal or Delphi will find it quite familiar.
The image below shows the EZGPIB integrated
development environment running, with a program I've written to control an
HP3586B selective voltmeter. The program scans a sequence of frequencies and
makes an amplitude and frequency measurement for each frequency. (In fact, it
makes five fast measurements, discards the high and low measurements and
averages the remaining three). The data is both displayed at the bottom of the
IDE and saved to a data file for later analysis and plotting.
If you wish to view the complete code for this program,
click here. (I've
changed the file extension from .488, the default for EZGPIB programs, to txt so
that it will be easier to view in a web browser.) Below the screen capture is a
sample data plot of the 3586B's output data.
|
|
|
 |
|
The plot below, done in Origin, shows raw data
(yellow) and 5 point adjacent average smoothing (red) for the signal strength of
AM broadcast station WXTR as measured on my 80-meter inverted vee antenna with
the HP3586B selective voltmeter running the program discussed above. The change
in detail between the left side of the plot and the right side is due to
implementing a signal averaging routine. The earlier data is one signal reading
every minute; the later data is captured via five fast readings once every three
minutes, but is the average of the middle three fast signal strength
measurements, with the high and low values discarded. |
 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|