May
2005, Issue 178
Network
GPIB Controller
by
Ron Battles, Patrick Jackson, & Scott Shumate
CLIENT
SOFTWARE
We
developed a client application to demonstrate and test
the capabilities of the networked controller. Our goal
was to provide a familiar user interface for a GPIB
device connected to our controller. In our case, this
was a Tektronix TDS-210 digital oscilloscope. An application
with a simple graphical user interface exposing enough
functionality to perform most of the basic operations
of an oscilloscope would do the trick.
We
had three basic requirements for the programming language.
The first was a free and functional XML-RPC client library.
Preferably, it would be open source. One of the main
reasons we chose XML-RPC was because of its prevalence,
so this requirement didn’t narrow the field too much.
A quick ’Net search returned free libraries for all
of the popular languages, including but not limited
to C/C++, Java, Microsoft.NET, Perl, Python, PHP, and
TCL.
The
second requirement was free and mature development tools,
including a compiler/interpreter and a windowing tool
kit. Again, this didn’t shorten the list much because
it only excluded .NET. Finally, to exploit one of our
device’s primary value-added features, we needed it
to be able to be embedded in the eZ80F91 microcontroller’s
HTTP server as a web browser applet. Of course, this
last requirement made Java the clear choice.
In
a nutshell, the client applet presents the oscilloscope’s
screen and controls translating user interactions into
GPIB calls and screen updates. The oscilloscope’s GPIB
interface is like a console that accepts ASCII commands
and queries. Commands and queries are sent from the
client to the oscilloscope as RPCs, invoking the GPIB
Send method. Answers to queries are read back with RPCs
invoking the GPIB Receive method. For example, to query
the vertical scale (i.e., volts per division) of channel
one, the “CH1:SCALE?” string is sent with a GPIB Send
RPC. To read the response to the query, a subsequent
GPIB Receive is sent. Listing 3
shows the steps in Java language.
Photo
2 shows the complete system running the Java client
application. The development board is in the foreground
with the ZPAK debugger connected. Immediately behind
the board is the GPIB driver circuit with a GPIB cable
wired to it. The other end of the GPIB cable is connected
to the back of the TDS-210 oscilloscope on the right.
The monitor in the back shows the Java client application
running on a Windows PC.
|

(Click
here to enlarge)
|
Photo
2—The functioning prototype was built around the
eZ80 Acclaim! development kit. Note that the waveform
displayed on the oscilloscope matches the waveform
on the client application. All of the eZ80F91 microcontroller’s
GPIO lines were conveniently available at headers.
The ZPAK made downloading and debugging code across
the network a snap. |
So
far, the network GPIB controller has been tested against
only the TDS-210, a National Instruments PCI-GPIB+ adapter,
and an older ISA adapter with a TMS9914A GPIB controller
on it. However, it performed well and with excellent
data throughput performance in all cases. The eZ80F91
microcontroller is well suited to an embedded network
control interface such as this one. It will save us
board space and additional cost with its integrated
flash memory and Ethernet MAC devices as well.
We’ve
passed some significant milestones in the development
of the network GPIB controller. Although we now have
an extremely functional prototype, we’d still like to
complete several tasks. As for the software, we need
to finish the GPIB driver because it doesn’t implement
the full IEEE 488.1 controller specification. The hardware
work is fairly obvious: turn the prototype into a circuit
board and put it into an enclosure.
We
achieved a high level of integration by choosing an
eZ80F91 microcontroller with a built-in Ethernet MAC
and incorporating a firmware-only GPIB controller. Using
the freely available ZTP TCP/IP stack and open-source
software components enabled us to cut development time
and costs. By choosing XML-RPC as the messaging layer,
we almost have off-the-shelf support for clients in
all of the popular programming languages, any of which
can be easily client-enabled with a minimal amount of
glue logic.
Editor’s
note: Ron, Patrick, and Scott won First Prize in the
Zilog 2004 Flash Nets Cash Design Contest for their
Network GPIB Controller. Visit www.circuitcellar.com/magazine/contests.htm
for more information.