Signal Recovery DSP7225#

Control the Signal Recovery DSP7225 lock-in amplifier from Python with the DSP7225 driver.

Library: pymeasure (docs)
Type: Lock-in amplifiers
Manufacturer: Signal Recovery

Signal Recovery DSP7225

Represents the Signal Recovery DSP 7225 lock-in amplifier.

Publishing through instro#

instro publishes the commands you send to a DSP7225 and the values you read from it, through any publisher. It takes two forms, both described in the pymeasure guide. Install with uv add "instro[pymeasure]".

With a PymeasureInstrument#

PymeasureInstrument wraps the driver in an instro instrument, with tags and background polling. The instrument is created inside the with block, and .device is the pymeasure instrument.

from pymeasure.instruments.signalrecovery import DSP7225
from instro.pymeasure import PymeasureInstrument

with PymeasureInstrument(
    name="lockin7225",
    instrument=DSP7225("GPIB0::12::INSTR"),
    dataset_rid="<dataset rid>",
) as lockin7225:
    lockin7225.device.imode = "voltage mode"       # Set to measure voltages
    lockin7225.device.reference = "internal"       # Use internal oscillator
    lockin7225.device.fet = 1                      # Use FET pre-amp
    lockin7225.device.shield = 0                   # Ground shields
    lockin7225.device.coupling = 0                 # AC input coupling
    lockin7225.device.time_constant = 0.10         # Filter time set to 100 ms
    lockin7225.device.sensitivity = 2E-3           # Sensitivity set to 2 mV
    lockin7225.device.frequency = 100              # Set oscillator frequency to 100 Hz
    lockin7225.device.voltage = 1                  # Set oscillator amplitude to 1 V
    lockin7225.device.gain = 20                    # Set AC gain to 20 dB
    print(lockin7225.device.x)                     # Measure X channel voltage
    lockin7225.device.shutdown()                    # Instrument shutdown

With existing pymeasure code (attach())#

attach() adds publishing to pymeasure code you already have. The imports, the attach() call after the instrument is created, and recorder.close() are all that instro adds.

from pymeasure.instruments.signalrecovery import DSP7225
from instro.lib import NominalCorePublisher
from instro.pymeasure import attach

lockin7225 = DSP7225("GPIB0::12::INSTR")
recorder = attach(lockin7225, "lockin7225", [NominalCorePublisher(dataset_rid="<dataset rid>")])
lockin7225.imode = "voltage mode"       # Set to measure voltages
lockin7225.reference = "internal"       # Use internal oscillator
lockin7225.fet = 1                      # Use FET pre-amp
lockin7225.shield = 0                   # Ground shields
lockin7225.coupling = 0                 # AC input coupling
lockin7225.time_constant = 0.10         # Filter time set to 100 ms
lockin7225.sensitivity = 2E-3           # Sensitivity set to 2 mV
lockin7225.frequency = 100              # Set oscillator frequency to 100 Hz
lockin7225.voltage = 1                  # Set oscillator amplitude to 1 V
lockin7225.gain = 20                    # Set AC gain to 20 dB
print(lockin7225.x)                     # Measure X channel voltage
lockin7225.shutdown()                    # Instrument shutdown

recorder.close()  # flush and close the publishers

The examples are adapted from the pymeasure documentation for DSP7225, which lists every property and method.

Send the data to Nominal#

With pymeasure, the Signal Recovery DSP7225 sends each reading to a Nominal dataset, where your team can plot it, compare runs, and analyze it together. This code creates an asset for the bench, a dataset and a run, and a workbook scoped to the run, then publishes the readings to the dataset. See Bench bring-up for the same steps on a whole bench.

from pymeasure.instruments.signalrecovery import DSP7225
from instro.lib import NominalCorePublisher
from instro.pymeasure import PymeasureInstrument

import pandas as pd
from nominal.core import NominalClient

client = NominalClient.from_profile("default")
bench = client.get_or_create_asset_by_properties(
    {"bench_id": "bench-1"}, name="Bench 1"
)
dataset = bench.get_or_create_dataset("bench", name="Bench 1 instruments")
run = bench.create_run(
    "Bench 1 session", start=pd.Timestamp.now(tz="UTC").floor("s"), end=None
)

dsp7225 = PymeasureInstrument(
    name="dsp7225",
    instrument=DSP7225("<visa_resource>"),
    publishers=[NominalCorePublisher(dataset=dataset)],
)

workbook = run.create_workbook(title="Signal Recovery DSP7225 readings")
print(workbook.nominal_url)  # open it to plot the channels

Open the Workbook link and plot the instrument’s channels, as in the mock below.

Illustrative mock of a Nominal workbook plotting Signal Recovery DSP7225 dataapp.gov.nominal.ioSignal Recovery DSP72… readingsPrimary tabCHANNELSdsp7225.xbenchdsp7225.ybench0.42x (V)0.040.050.06y (V)12:00:0012:00:1012:00:2012:00:3012:00:4012:00:502026-01-01
An illustrative mock of the workbook. The channels are named for the instrument, and the traces are made up.

Find out if your company is using Nominal