Skip to content

Connecting to HMP 4030 by Rohdes&Schwarz in Python

Instrument Card

The Rohde & Schwarz HMP4030 power supply belongs to the HMP series and has 3 channels and a power of 384W. All three channels have an output voltage of 0-32V and an output current of 0-10A. The Rohde & Schwarz HMP series are programmable DC power supplies.

Device Specification: here

Manufacturer card: ROHDES&SCHWARZ

Rohde & Schwarz GmbH & Co KG is an international electronics group specializing in the fields of electronic test equipment, broadcast & media, cybersecurity, radiomonitoring and radiolocation, and radiocommunication.

  • Headquarters: Munich, Germany
  • Yearly Revenue (millions, USD): 2500
  • Vendor Website: here

Demo: Measure a solar panel IV curve with a Keithley 2400

Connect to the HMP 4030 in Python

PROTOCOLS > SCPI

To connect to a Rohde & Schwarz HMP4030 Power Supply using Qcodes Community, you can use the following Python script:

from qcodes.instrument_drivers.rohde_schwarz.HMP4030 import RohdeSchwarzHMP4030
# Create an instance of the HMP4030 driver
hmp = RohdeSchwarzHMP4030('hmp', 'TCPIP0::192.168.0.1::INSTR')
# Connect to the instrument
hmp.connect()
# Now you can use the instrument for various operations
# For example, you can set the output voltage
hmp.voltage(5) # Set the output voltage to 5V
# You can also read the current output voltage
voltage = hmp.voltage()
print(f"Output voltage: {voltage}V")
# Disconnect from the instrument
hmp.disconnect()

In this script, we import the RohdeSchwarzHMP4030 class from the qcodes.instrument_drivers.rohde_schwarz.HMP4030 module. We then create an instance of the driver by providing a name for the instrument ('hmp') and the instrument’s address ('TCPIP0::192.168.0.1::INSTR').

Next, we connect to the instrument using the connect() method. After connecting, we can perform various operations on the instrument. In this example, we set the output voltage to 5V using the voltage() method and then read the current output voltage using the same method.

Finally, we disconnect from the instrument using the disconnect() method.