Eurotest HPP120256#

Control the Eurotest HPP120256 power supply from Python with the EurotestHPP120256 driver.

Library: pymeasure (docs)
Type: Power supplies
Manufacturer: Eurotest

Represents the Euro Test High Voltage DC Source model HPP-120-256 and provides a high-level interface for interacting with the instrument using the Euro Test

Publishing through instro#

instro publishes the commands you send to a EurotestHPP120256 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.eurotest import EurotestHPP120256
from instro.pymeasure import PymeasureInstrument

with PymeasureInstrument(
    name="hpp120256",
    instrument=EurotestHPP120256("GPIB0::20::INSTR"),
    dataset_rid="<dataset rid>",
) as hpp120256:

    print(hpp120256.device.id)
    print(hpp120256.device.lam_status)
    print(hpp120256.device.status)

    hpp120256.device.ramp_to_zero(100.0)

    hpp120256.device.voltage_ramp = 50.0  # V/s
    hpp120256.device.current_limit = 2.0  # mA
    inst.kill_enabled = True  # Enable over-current protection
    time.sleep(1.0)  # Give time to enable kill
    inst.output_enabled = True
    time.sleep(1.0)  # Give time to output on

    abs_output_voltage_error = 0.02 # kV

    hpp120256.device.wait_for_output_voltage_reached(abs_output_voltage_error, 1.0, 40.0)

    # Here voltage HV output should be at 0.0 kV

    print("Setting the output voltage to 1.0kV...")
    hpp120256.device.voltage_setpoint = 1.0  # kV

    # Now HV output should be rising to reach the 1.0kV at 50.0 V/s

    hpp120256.device.wait_for_output_voltage_reached(abs_output_voltage_error, 1.0, 40.0)

    # Here voltage HV output should be at 1.0 kV

    hpp120256.device.shutdown()

    hpp120256.device.wait_for_output_voltage_reached(abs_output_voltage_error, 1.0, 60.0)

    # Here voltage HV output should be at 0.0 kV

    inst.output_enabled = False

    # Now the HV voltage source is in safe state

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.eurotest import EurotestHPP120256
from instro.lib import NominalCorePublisher
from instro.pymeasure import attach

hpp120256 = EurotestHPP120256("GPIB0::20::INSTR")
recorder = attach(hpp120256, "hpp120256", [NominalCorePublisher(dataset_rid="<dataset rid>")])

print(hpp120256.id)
print(hpp120256.lam_status)
print(hpp120256.status)

hpp120256.ramp_to_zero(100.0)

hpp120256.voltage_ramp = 50.0  # V/s
hpp120256.current_limit = 2.0  # mA
inst.kill_enabled = True  # Enable over-current protection
time.sleep(1.0)  # Give time to enable kill
inst.output_enabled = True
time.sleep(1.0)  # Give time to output on

abs_output_voltage_error = 0.02 # kV

hpp120256.wait_for_output_voltage_reached(abs_output_voltage_error, 1.0, 40.0)

# Here voltage HV output should be at 0.0 kV

print("Setting the output voltage to 1.0kV...")
hpp120256.voltage_setpoint = 1.0  # kV

# Now HV output should be rising to reach the 1.0kV at 50.0 V/s

hpp120256.wait_for_output_voltage_reached(abs_output_voltage_error, 1.0, 40.0)

# Here voltage HV output should be at 1.0 kV

hpp120256.shutdown()

hpp120256.wait_for_output_voltage_reached(abs_output_voltage_error, 1.0, 60.0)

# Here voltage HV output should be at 0.0 kV

inst.output_enabled = False

# Now the HV voltage source is in safe state

recorder.close()  # flush and close the publishers

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

Send the data to Nominal#

With pymeasure, the Eurotest HPP120256 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.eurotest import EurotestHPP120256
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
)

eurotesthpp120256 = PymeasureInstrument(
    name="eurotesthpp120256",
    instrument=EurotestHPP120256("<visa_resource>"),
    publishers=[NominalCorePublisher(dataset=dataset)],
    poll=["current"],
)
eurotesthpp120256.start()  # poll in the background, and send each reading to the dataset

workbook = run.create_workbook(title="Eurotest HPP120256 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 Eurotest HPP120256 dataapp.gov.nominal.ioEurotest HPP120256 readingsPrimary tabCHANNELSeurotesthpp120256.curre…bencheurotesthpp120256.ch1.v…bench00.51current (A)02.55voltage (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