Skip to content

Connecting to HMP 4040 by Rohdes&Schwarz in Python

Instrument Card

The Rohde & Schwarz HMP4040 power supply belongs to the HMP series and has 4 channels and a power of 384W. All four channels have an output voltage of 0-32V and an output current of 0-10A.

HMP 4040

Device Specification: here

Manufacturer card: ROHDES&SCHWARZ

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 4040 in Python

PROTOCOLS > SCPI

from pymeasure.adapters import VISAAdapter
from pymeasure.instruments import HMP4040
# Create a VISA adapter for communication
adapter = VISAAdapter("TCPIP::192.168.1.1::INSTR")
# Connect to the HMP4040 Power Supply
power_supply = HMP4040(adapter)
# Perform operations on the power supply
power_supply.beep() # Emit a single beep from the instrument
power_supply.control_method = "REM" # Set the control method to remote
voltage = power_supply.voltage # Get the output voltage
print("Output Voltage:", voltage)
current = power_supply.current # Get the output current
print("Output Current:", current)
power_supply.voltage = 5.0 # Set the output voltage to 5.0 V
power_supply.current = 1.0 # Set the output current to 1.0 A
power_supply.output_enabled = True # Enable the output
# Disconnect from the power supply
power_supply.disconnect()

This script connects to the HMP4040 Power Supply using a VISA adapter and performs various operations such as emitting a beep, setting the control method to remote, getting and setting the output voltage and current, enabling the output, and finally disconnecting from the power supply.