Skip to content

First Measurement

This tutorial takes you from a connected bridge to a real voltage reading on a multimeter. You will identify an instrument, configure it for DC voltage measurement, capture a reading, and return the instrument to front panel control when you are done.

Before starting this tutorial, make sure you have completed the Getting Started tutorial. You should have:

  • mcgpib installed and registered with Claude Code
  • A bridge configured and connectable
  • At least one multimeter on the GPIB bus (this tutorial uses a Keithley 2000, but the commands work with any IEEE 488.2 / SCPI multimeter like the HP 34401A, Keithley 2010, or Agilent 34461A)

Start a Claude Code session and connect to your bridge if it is not already connected.

  1. Connect and identify

    > Connect to bench-a and identify the instrument at address 5

    Behind the scenes, Claude calls two tools:

    • connect_bridge("bench-a") — opens the serial connection and initializes the bridge
    • instrument_identify("bench-a", 5) — sends *IDN? to address 5

    The response shows the parsed identification:

    Address 5 on bench-a:
    Manufacturer: KEITHLEY INSTRUMENTS INC.
    Model: 2000
    Serial: 1234567
    Firmware: A04 /A02
    Raw: KEITHLEY INSTRUMENTS INC.,2000,1234567,A04 /A02

    The *IDN? response follows the IEEE 488.2 standard format: four comma-separated fields for manufacturer, model, serial number, and firmware version. This tells you exactly what you are talking to and which command set it supports.

SCPI instruments separate configuration from triggering. First you tell the instrument what to measure, then you tell it to take the measurement.

  1. Set up for DC voltage

    > Configure the Keithley 2000 at address 5 for DC voltage measurement

    Claude calls instrument_write("bench-a", 5, "CONF:VOLT:DC"):

    Sent to address 5: CONF:VOLT:DC

    The CONF:VOLT:DC command tells the multimeter to measure DC voltage with auto-ranging and default resolution. The instrument switches its display to the DC voltage function if it was on a different measurement mode.

  2. Verify the configuration (optional)

    To confirm the instrument accepted the configuration:

    > What function is the Keithley set to?

    Claude calls instrument_query("bench-a", 5, "CONF?"):

    "VOLT:DC +1.000000E+01,+1.000000E-06"

    This confirms DC voltage mode on the 10V range with 1uV resolution (the auto-selected defaults for the Keithley 2000).

  1. Read the measurement

    > Read the DC voltage on the Keithley

    Claude calls instrument_query("bench-a", 5, "READ?"):

    +3.29847E+00

    That is 3.29847 volts DC. The READ? command triggers a new measurement and returns the result in a single operation.

  2. Understanding the response format

    SCPI instruments return numbers in scientific notation: +3.29847E+00 means 3.29847 x 10^0, which is 3.29847. Some common patterns:

    ResponseValue
    +3.29847E+003.29847 V
    +1.20000E-031.2 mV (0.0012 V)
    -5.67890E+01-56.789 V
    +9.90000E+37Overload (out of range)

    The +9.9E+37 value is a special sentinel that means the input exceeds the selected range. If you see this, either the signal is too large for the current range or nothing is connected to the input terminals.

  3. Take multiple readings

    For a quick series of measurements, you can ask Claude directly:

    > Take 5 DC voltage readings from the Keithley, one second apart

    Claude will call instrument_query("bench-a", 5, "READ?") five times, pausing between each. A typical conversation might look like:

    Reading 1: +3.29847E+00 (3.298 V)
    Reading 2: +3.29851E+00 (3.299 V)
    Reading 3: +3.29849E+00 (3.298 V)
    Reading 4: +3.29853E+00 (3.299 V)
    Reading 5: +3.29846E+00 (3.298 V)
    Average: 3.29849 V, Std Dev: 0.000028 V
    The readings are stable to within ~30 uV.

    The LLM handles the arithmetic and interpretation. You asked a plain question and got a plain answer — that is the point.

When you are finished taking measurements, return the instrument to local (front panel) control. Without this step, the instrument stays in remote mode and the front panel buttons are locked out.

> Return the Keithley to local control

Claude calls instrument_local("bench-a", 5):

Instrument at address 5 returned to local control

The instrument’s front panel is active again. The “RMT” indicator (if the instrument has one) turns off.

The same pattern — configure, read, clean up — works for any measurement function. Here are quick examples for common types.

> Configure the Keithley for AC voltage and take a reading

Tools called:

  • instrument_write("bench-a", 5, "CONF:VOLT:AC")
  • instrument_query("bench-a", 5, "READ?")
Sent to address 5: CONF:VOLT:AC
+1.20345E+02

120.345 VAC — typical mains voltage.