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.
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 4040 in Python
Read our guide for turning Python scripts into Flojoy nodes.
PROTOCOLS > SCPI
from pymeasure.adapters import VISAAdapterfrom pymeasure.instruments import HMP4040
# Create a VISA adapter for communicationadapter = VISAAdapter("TCPIP::192.168.1.1::INSTR")
# Connect to the HMP4040 Power Supplypower_supply = HMP4040(adapter)
# Perform operations on the power supplypower_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 voltageprint("Output Voltage:", voltage)
current = power_supply.current # Get the output currentprint("Output Current:", current)
power_supply.voltage = 5.0 # Set the output voltage to 5.0 Vpower_supply.current = 1.0 # Set the output current to 1.0 A
power_supply.output_enabled = True # Enable the output
# Disconnect from the power supplypower_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.