The HP3455A is a mid 1980's product. It still has respectable specifications as a meter, with 6 1/2 digit resolution. The instrument is old enough that the GPIB language is not SCPI, but R2D2. This tool will convert the R2D2 into human readable language. Sending commands and reading data are fairly straight forward, reading the configuration is kind of messy.

All of the GPIB commands listed in the programming section of the manual are supported. Commands can be supplied to the tool on the shell command line, from a script file, or from an internal shell-like mode. Arbitrary delays between commands can be set. Capturing multiple measurements to a file with a user supplied delay between measurements is also possible.

This tool reuses the architecture of the project #HP34401A Meter Command Line Control Software Tool . Both tools share a lot of their source code. GPIB interface tasks are handled by the linux-gpib library that is available via Source Forge and other places. Linux-gpib supports many different interface boards and dongles. Development was done under Fedora 40 and tested on several other Fedora versions. You must install the linux-gpib package before building this tool.

Both the linux-gpib library and the National Instruments NI488-2 libraries are compatible with each other with minor exceptions. It is possible to build this package to run under Windows using the NI488-2 library. Instructions to do so can be found in my #HP545xx Data Acquisition Software project.

In order to build this project on a Linux machine, you must already have the linux-gpib package installed. There is a .h file needed at compile time and a library that is needed at link time for this package to compile successfully. Create a working directory to build the tool in and copy the .tgz file into it. Un-tar the file and type make:

> mkdir HP3455A_ctl

> cd HP3455A_ctl

> cp wherever/HP3455A_ctl_xx_xx_xxxx.tgz  .

> tar -xzvf HP3455A_ctl_xx_xx_xxxx.tgz

> make

and the software should build with no errors or warning messages. Finally, copy or link the executable program to a convenient directory in your executable path like ~/bin. There should be no need to do any of these tasks as root unless you want to put the executable in a directory off the /usr tree.

The default address for the HP3455A (currently 4) is stored in the file HP3455A.h. If your instrument is not configured for that GPIB address, you can edit the file and re-compile or you can use the -d command line option to supply the correct address.

Typing ./HP3455A_ctl    with no parameters will give you a command listing:

Usage: HP3455A_ctl [-d DEV_Address] CMD1 [arg1] [CMD2...

  where CMDn [argn] is one of:

The configuration options (starting with -) must all be before the first command.

HELP without a command shows this same list of commands. With a command, it shows the command name followed by any arguments required (the same as the list shown above) .

READ_CMDFILE CMDFILENAME  allows reading multiple commands from a text file. This is a "system command" . Most messages shown will indicate the line number of the file to make it easier to find and fix script problems. Commands are sent to the HP3455A as they are encountered. Any errors in commands or parameters or instrument responses will terminate the command file execution.

INTERACTIVE {TOLERANT] allows running multiple commands without the program disconnecting from the meter. This means that you don't have to prefix each meter command with the program name. The default mode of error handling is to exit the program on finding an error. If you add the TOLERANT option, you get the error messages, but the program continues in INTERACTIVE mode. This is useful to avoid aggravation if one is not a "precision" typist :). Commands are sent to the HP3455A as they are encountered. This is a "system command".

SLEEP_MS NmilliSeconds inserts a delay between commands. Most GPIB instruments are not especially fast by modern standards, so command files will usually need a delay of 10 to 100mS inserted between commands. Delays are generated in the Linux operating system and are not super accurate. This is a "system command".

GET_MEAS reads the last conversion value from the meter as one would expect.

The next 11 commands are meter commands, best explained by the HP3455A manual.

GET_CONFIG [disp] retrieves the meter configuration into the internal if_msg_block that is passed between all the commands. If the disp option is included, the meter configuration is shown on the screen. Newer instruments allow reading individual settings like mode or range individually, the HP3455A only returns the settings in one blob. Some of the GPIB operations performed by the meter change internal settings. The GET_CONFIG in conjunction with RESTORE_CONFIG allow keeping the same configuration after those operations. Operations that change the configuration are explained in the HP3455A manual.

RESTORE_CONFIG sets the meter configuration to match the values stored in the if_msg_block structure.

FETCH_TO_FILE Num dwell_ms Filename allows capturing multiple (Num) measurements to file (Filename) with a delay (dwell_ms) between measurements. Measurement times for the HP3455A are variable, depending on the meter configuration. This command attempts to estimate the measurement time before fetching the measurement value. It is possible that the previous measurement value is captured again if there is a delay in starting the measurement or the code estimating the measurement time is incorrect (this IS beta code).

FETCH_TO_FILE_HS   Num dwell_ms Filename also allows capturing multiple measurements to a file. The HP3455A can be configured to set the Ready status bit when a measurement is complete. This version of the command polls the Ready status bit and captures the measurement value after the Ready Status bit is asserted. Since the trigger/capture events use handshaking, this should avoid issues with capturing the same measurement twice. This command is experimental and has limited testing.

SHOW_MSG_BLOCK shows the contents of the internal if_mg_block structure. This may or may not be completely correct, depending on whether the GET_CONFIG command has been executed in this run of the program. Note that the contents of the if_msg_block structure are volatile and only reflect changes made or status seen on this execution of the program. It is of limited use  when running instrument commands from the shell command line. It is more useful when using either the READ_CMDFILE or INTERACTIVE modes. It is mostly a program debug command.

DEV_CLR is a low level GPIB command that resets the state of the HP3455A to a known (by the manual) configuration.

DEV_LOCAL is a low level GPIB command that tells the HP3455A to accept front panel commands. It is only useful in READ_CMDFILE or INTERACTIVE situations.

GRP_TRIGGER is a low level GPIB command that can be used to start a measurement cycle if the HP3455A is configured for MANUAL or EXTERNAL trigger operation. It is used in the FETCH_TO_FILE_HS command.

SERIAL_POLL is a low level GPIB command that fetches the instrument status byte. It is used in the FETCH_TO_FILE command.

SHOW_RESPONSE cmd_string is a debug command. It allows sending any arbitrary cmd_string and reading back the HP3455A response to that string.

SEND_CMD cmd_string is a debug command. It allows sending any arbitrary cmd_string. It does not read anything back.

Commands may be entered in upper or lower case.

Multiple commands may be entered on the shell command line:

> HP3455A_ctl set_mode dc_volts   sleep_ms 25   set_range 10   sleep_ms 25   get_meas

will set the meter to read DC volts with a range of +/- 10 volts and return one reading with 25mS pauses between steps.

The same can be done in a command file. Create a text file foo.txt containing:

   set_mode dc_volts

   sleep_ms 25

   set_range 10

  sleep_ms 25

   get_meas

Run the command file:

> HP3455A_ctl READ_CMDFILE foo.txt

and the same operations will be done.

One of the main uses for the INTERACTIVE mode is when this program is run by exec'ing if from another program. Piping stdin and stdout from this program in INTERACTIVE mode allows the calling program full control over the HP3455A.

The software is written in layers. The main function calls the parse_and_exec  () function that parses the instrument commands. In the parse_and_exec.c file, the individual instrument commands get their parameters parsed and then call low level commands in HP3455A.c that assemble the outgoing strings, communicate with the GPIB driver and fetch results. The low level file (HP3455A.c and .h) could be used in a GUI driven program with the GUI software calling the low level command handling functions.