HPKit

The HPKit suite is a set of Linux CLI tools used to control test equipment, Hewlett Packard/Agilent and others, with a GPIB/HPIB interface adapter (currently it fully supports the Prologix GPIB Controller 6.0 adapter, but it may work with others).

The HPKit suite contains three tools:

  • hplot;
  • hplisten;
  • hptalk;
  • hprologix.

To use correctly these tools, you must have permission to access the device you’re communicating with. This can usually be done by either having root privileges or belonging to the dialout group.

hplot

Hplot is an HP plotter emulator that dumps or saves to a file a screenshot of the instrument’s display using HPGL printing language. You can use it with hp2xx (a tool from the GNU project which renders an HPGL file and coverts it to an image).

An example call to hplot and hp2xx is:

$ hplot --device /dev/ttyUSB0 --address 5 | hp2xx -q
hplot result example

hplot + hp2xx plot result example

As soon as you have executed the command you have about 2 seconds to start a plot from your test equipment (you can find more information about starting a plot in the instrument’s user or programming manual). If all goes well, after about a minute a window will open (if using a Window Manager), showing a screenshot of your instrument’s display.

hplisten

Hplisten is very similar to hplot. The only difference is that it only dumps or saves the received data, without emulating a plotter as hplot does.

An example call to hplisten is:

$ hplisten --device /dev/ttyUSB0 --address 15 --output plot.bmp
hplisten plot result example

hplisten plot result example (converted BMP > JPEG)

This command can be used to get a screenshot from test equipment which only sends plot data without waiting for any answer, like for example Tektronix scopes. The program will wait for about a minute, then it will exit. In the directory where you executed the command you’ll find a file called  “plot.bmp”

hptalk

Hptalk is a very simple tool used to send commands to the instrument and read its answer.

A common call to this tool is:

 $ hptalk --device /dev/ttyUSB0 --address 20 RST

This call sends to the instrument the command “RST” (instrument reset) and if there is any output it prints it out on stdout.

hprologix

Hprologix is a tool to read and set the Prologix GPIB adapter configuration.

To get the current configuration:

 $ hprologix --get-config
Mode: Controller
Address: 20 (PAD)
EOI: Disabled
EOT: Disabled
EOS: CR+LF
$

To set default options:

 $ hprologix
Configuring the Prologix adapter with default values
$

Other examples:

  • setting adapter mode and address
     $ hprologix --mode=1 --address=20
  • sending reset signal
     $ hprologix --signal=RST
    Sending signal RST
    $

Note that when you use hprologix to configure the adapter, you may run the other tools with –adapter=none to avoid overriding your setup.

For full information about the usage and the available options, run:

hprologix --help

Notes

Help pages refer to HPKit v0.2.1, which is the old version. Release 0.2.5, which is currently available in the devel branch, is the newest one, and is a lot more powerful, enabling you to define your own adapter, in a plain XML file.

Reply