Why a Python tool for an old Multimeter?
For various tests at home, such as my temperature dependency tests of current sources, I needed a tool to
capture measurement data and store it in a CSV file or another suitable format.
Since I had an old HP 3457A lying around that I had always wanted to use for exactly these kinds of tasks, I
started looking for software that could fulfill my needs. Unfortunately, the only solutions I could find
were either paid or focused on different interfaces than the one I am using. My setup currently relies on an
NI USB HS+ GPIB interface.
After doing some reading about GPIB communication, I decided to simply write my own software in Python.
Shouldn't take more than an hour or so, right?
Well, of course, it didn't go quite as quickly as I had hoped. Since this is just a hobby project, I
sometimes struggle to find enough time to work on and finish these kinds of projects.
On top of that, I quickly realized that things weren't quite as straightforward as I had initially expected.
It all started with the basic initialization of the GPIB communication, which naturally worked on the first time and
afterwards never again. After countless internet searches
and eventually digging through the user manual, I finally found the missing piece: I had to explicitly send
END ALWAYS to the instrument. Without this command, communication would randomly fail.
Another issue was that simply sending PRESET wasn't sufficient. The device also needed to be explicitly
reset, otherwise the HP 3457A would occasionally struggle to establish a connection.
Of course, these seemingly minor details took far longer to figure out and fix than I would have liked.
Additionally, whenever I couldn't work on the project for an extended period, I basically forgot everything
I had previously figured out and had to familiarize myself with the code all over again. This is also why
some parts of the code might feel a little thrown together. But hey, that's how hobby projects sometimes go!
Nevertheless, I'm quite happy to finally present a functional GUI tool based on
pygubu-designer. (Pygubu is
awesome, by the way. I really love the way it is designed and how it works!)
MY tool can communicate with the HP 3457A and allows you to configure its basic measurement settings.
Additionally, it provides several ways to display measurement data, including live measurement statistics
and a switchable histogram for a better overview of the acquired data. And, of course, it supports exporting
everything to CSV files.
Well, I originally started this project with nothing more than a simple CSV logger in mind, but things
escalated rather quickly. :)
One particularly nice feature is that the tool uses TRG SYN as its measurement query command. This makes the
instrument wait for a trigger before executing the measurment and returning the measurement result, meaning that the timestamps recorded
for each measurement should be reasonably accurate.
Getting Started / How to Use
Getting started with the tool is fairly straightforward.
1. Connecting and configuring the instrument
First, navigate to the Settings page and establish a connection to the HP 3457A using your GPIB interface.
Once connected, you can adjust the instrument's measurement settings to suit your needs. These include:
- NPLC Number of Power Line Cycles.
- AC Bandwidth AC measurement bandwidth.
- ACDC AC Mode defaults to AC+DC Measurement mode.
- NRDG Number of readings.
- Digits Measurement resolution.
You can leave these settings at their defaults or adjust them depending on the type of measurement you want
to perform.
See the image on the right for an overview of the Settings page.
2. Selecting the measurement function
After establishing the connection and configuring the instrument, switch to the Main page.
Here you can select the measurement function you want to use, such as:
- VDC DC Voltage
- VAC AC Voltage
- IDC DC Current
- IAC AC Current
- OHM Resistance
- OHMF Resistance 4 Wire
- FREQ Frequency
Once the desired measurement function has been selected, you can start acquiring measurement data.
The acquired data is displayed in the GUI, together with measurement statistics. You can also switch the
histogram view on or off to get a better impression of the distribution of your measurements.
See the image on the right for an overview of the Main page and its measurement displays.
3. Saving measurement data to CSV
The CSV page provides the functionality for saving your measurement data.
There is a Continuous Save option that determines how the data is written to the selected CSV file:
- Continuous Save enabled: Measurement data is continuously written to the selected CSV file as it is
acquired.
- Continuous Save disabled: Only the measurement data acquired up to that point is saved when you initiate
the save operation.
This gives you the flexibility to either continuously log long-running measurements or simply export the
data after completing a measurement session.
See the image on the right for an overview of the CSV saving page.
The source for teh project can be found here
HP-3457A-Measurement-Data-Logger