Use Claude Code and PyTestLab to check whether your multimeter is programmable, take ten DC voltage readings and save them to a CSV and plot.
You can control a multimeter with AI if the meter has a supported programmable interface. Claude Code can help you find that out before you install drivers, buy a cable or write code. A USB connector, wireless app or logging feature does not by itself prove that software can select a measurement function and request a reading.
Once the connection is established, PyTestLab keeps the experiment small. This guide takes you from checking your meter to collecting DC voltage readings in a CSV and plotting them. It targets PyTestLab 0.3.0 and its built-in VISA discovery CLI.
Start here: ask Claude whether your multimeter can be controlled#
Get the agent skills: github.com/labiium/pytestlab-skills. Use pytestlab-onboarding for setup, pytestlab-experiments for Bench-based procedures, and ptl-profile-skill when a model needs a profile.
Open Claude Code in a new experiment folder on the computer connected to the meter, or on a computer that can reach its LAN interface. Install the skills in that project:
npx skills add labiium/pytestlab-skills --skill pytestlab-onboarding pytestlab-experiments ptl-profile-skill -a claude-code -y
The installer needs Node.js/npm. If you do not have it, use the Git installation instructions. Python is not needed to install the skills.
Give Claude the exact manufacturer and model, then paste this prompt:
My multimeter is [manufacturer and exact model]. Read the three installed PyTestLab skills. Check the manufacturer's programming manual for remote measurement support, the interface, and any required options or drivers. A USB port alone doesn't prove the meter is programmable.
If the meter is supported, keep my working project environment if I have one. Otherwise create a project .venv. If Python is missing, use uv from Astral's official installer to set up Python 3.14 without changing the system Python. Install PyTestLab 0.3.0 in the project environment and use it for every command.
Find the selected meter and prepare bench.yaml with a matching profile. If the profile is missing, use the programming manual and the profile-authoring skill. Draft a script that saves ten DC voltage readings to readings.csv. Show me the resource, profile, input terminals and measurement range. Wait for my approval before opening or operating the meter.
The first useful answer is a short compatibility decision: which interface, which manual, which profile, and what is missing. If the meter cannot be remotely controlled, the agent should say so. It can still analyse manually entered or exported readings, but that is a different workflow.
What counts as a programmable multimeter?#
Look for a programming guide that documents commands to configure a function, start an acquisition and retrieve results. Common transports include USB, LAN, GPIB and serial; the connector and protocol must both match the model.
The Keysight Truevolt programming documentation, for example, documents SCPI remote operations and interface configuration. Other meters may expose readings through a vendor adapter or application without offering equivalent configuration control. A product page describing remote monitoring is not a substitute for its programming specification.
Ask Claude to check these four things in the official documents:
- Exact model and options: a similar model number can have different interfaces or optional features.
- Purpose of the port: USB remote control, USB storage and charging are not interchangeable.
- Command support: can software select DC voltage and request a fresh reading, or only download existing logs?
- Connection requirements: cable/adapter, enabled interface, driver/backend and supported operating system.
A profile cannot add remote-control hardware that the meter does not have. It can implement a documented interface that PyTestLab does not yet support.
Your first result: ten readings in one file#
After the agent has verified the interface and prepared bench.yaml, save this as measure.py in the same directory:
import polars as pl
from pytestlab import Bench
with Bench.open("bench.yaml") as bench:
readings = [
float(bench.meter.measure("dc_voltage", range_val=10))
for _ in range(10)
]
pl.DataFrame({
"reading": range(1, 11),
"voltage_V": readings,
}).write_csv("readings.csv")
Run it from that project directory using its Python environment:
.venv/bin/python measure.py
On Windows, use .venv\Scripts\python.exe measure.py.
You should get readings.csv in the current project directory, with ten rows and two columns: reading and voltage_V. Ask Claude to show the actual saved path, verify the row count and inspect the values. Do not treat an error, overload or unavailable reading as a valid voltage.
Here range_val=10 requests the profile's 10 V measurement range. It does not generate or apply 10 V. Use a known low-voltage DC signal that fits the selected range. The example converts each structured result to its nominal numeric value for a simple CSV; retain the full result when you need uncertainty metadata.
Before running on real hardware: use the meter's voltage input terminals and the physical setup specified by its manual. Do not use a current-input jack for this voltage measurement. Start with an appropriate low-voltage test source, not mains. Changing the function in software does not move the leads or make a different wiring arrangement safe.
How Claude sets up PyTestLab and the connection#
Keep the agent's existing compatible project environment. For a new project with no Python, the agent can install uv from Astral and run:
uv python install 3.14 --no-bin
uv venv --managed-python --python 3.14 .venv
uv pip install "pytestlab==0.3.0"
uv run ptl --version
PyTestLab installs Polars and Matplotlib for the examples, as well as the PyVISA API and PyUSB for instrument access; keep a working VISA backend.
For a meter connected through VISA, list the resources using the same project environment:
uv run ptl visa list
If you're not using uv, run ptl visa list inside your activated project environment.
Select the resource belonging to your meter. Discovery is not proof of model compatibility, and an empty list does not prove that a network meter is unsupported. Use the known resource address from its configuration when discovery does not find it. A non-VISA vendor protocol may need its own transport integration rather than this command.
Only if the backend is missing should the agent diagnose it with pyvisa-info and add the appropriate component, such as pyvisa-py. Pure-Python USB support may also require a system USB library or platform driver. See the installation guide for setup; let the agent handle the specific missing dependency, not ask you to install a list of unrelated drivers.
Describe the bench once#
For a Keysight 34470A, an example descriptor is:
bench_name: DC voltage measurements
instruments:
meter:
profile: keysight/34470A
address: TCPIP0::YOUR_METER_HOST::inst0::INSTR
Replace that example resource with the actual USB/LAN/GPIB resource and use the profile matching your meter. The name meter becomes bench.meter in the script. Your connection details stay in the descriptor rather than appearing in every experiment.
The agent can inspect available profiles with ptl profile list. If none matches, the profile-authoring skill uses the official programming manual to map commands, parameters and response formats, then checks the profile against the installed PyTestLab schema. Validate the requested operations on the selected hardware before claiming the new profile works. Some devices need driver/parser work as well as YAML.
Try the workflow without an instrument#
To test the scripts without connecting to a meter, save this simulator configuration as bench.yaml in a separate experiment folder and run the same scripts with your project's Python:
bench_name: Simulated DC voltage measurements
simulate: true
instruments:
meter:
profile: keysight/34470A
No VISA address is needed for this simulator. The built-in profile can return a flat series of zeros. That still checks the CSV and plot workflow, but it says nothing about the accuracy of a real meter.
Start with a single reading when debugging#
If the ten-reading example fails, make the procedure smaller rather than adding more abstraction. This is the basic PyTestLab measurement:
from pytestlab import Bench
with Bench.open("bench.yaml") as bench:
result = bench.meter.measure("dc_voltage", range_val=10)
print(result.values)
The function name comes from the profile. The agent should inspect the supported functions and ranges for your model instead of inventing calls such as get_voltage().
This is also the right place to check whether the meter is waiting for a trigger, has the wrong input selected, or is reporting an overload. Preserve the error and check the documented state rather than blindly repeating the command or resetting the bench.
Turn the saved readings into a plot#
Save this complete script as plot_readings.py alongside readings.csv:
import polars as pl
import matplotlib.pyplot as plt
readings = pl.read_csv("readings.csv")
plt.plot(readings["reading"], readings["voltage_V"], marker="o")
plt.xlabel("Reading number")
plt.ylabel("DC voltage (V)")
plt.tight_layout()
plt.savefig("readings.png", dpi=160)
Run:
.venv/bin/python plot_readings.py
The result is readings.png in the same directory, ready to inspect in your editor or share. The Windows interpreter path is the same substitution as above. The script saves a file rather than requiring a GUI window, so it also works in a headless agent environment.
Reading number is deliberately not labelled time. A Python loop takes sequential measurements, but integration time, triggering and communication affect their spacing. For a timed experiment, record suitable timestamps or use the meter's documented timed acquisition/buffer features. Do not infer a precise sample rate from how quickly the agent returns an answer.
What can you automate next?#
Once one measurement works, reuse the same Bench setup for a longer record, repeated checks of a stable source, comparisons before and after a change, or a report built from saved data. The model can develop the procedure; Python handles the repetitive work.
Do not turn the voltage example into a current or resistance test by changing only the function string. Current measurement needs the correct input and circuit arrangement; resistance/continuity measurements require the appropriate de-energized setup. Let the agent explain the required change before anyone changes the wiring or runs the procedure.
This approach does not require an MCP server: Claude Code can run PyTestLab on the computer connected to the meter. MCP can expose a saved procedure later if your agent workflow needs remote tools. Why code is a useful medium for laboratory agents explains that separation. For waveform capture rather than a single scalar reading, see the AI oscilloscope guide.
Give Claude your model number and start#
Install the PyTestLab skills, paste the compatibility prompt above and ask for one working measurement. A verified interface, a reusable profile and a short Bench script are the foundation. Ten saved readings are a better first milestone than a complicated autonomous-lab architecture.
Software checks for this guide used the PyTestLab API and an explicit multimeter simulator. The capture, CSV and plotting paths were tested without physical equipment. Simulator values are not evidence of measurement accuracy; your meter, connection and physical setup still need verification.