Skip to content

Connecting to Keysight E3631A by HP in Python

Instrument Card

E3631A 80W Triple Output Power Supply, 6V, 5A & ±25V, 1A

Keysight E3631A

Device Specification: here

Manufacturer card: HP

HP

Keysight Technologies, or Keysight, is an American company that manufactures electronics test and measurement equipment and software

  • Headquarters: USA
  • Yearly Revenue (millions, USD): 5420
  • Vendor Website: here

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

Connect to the Keysight E3631A in Python

PROTOCOLS > SCPI

To connect to a Keysight E3631A Power Supply using Instrumentkit, you can use the following Python script:

import instrumentkit as ik
# Connect to the power supply
psu = ik.hp.HPe3631a.open_gpibusb("/dev/ttyUSB0", 10)
# Set the channel to P25V
psu.channel[2]
# Set the output voltage to 12.5V
psu.voltage = 12.5
# Read back the set voltage
print(psu.voltage)
# Read back the sensed voltage
print(psu.voltage_sense)

This script first imports the instrumentkit module as ik. Then, it connects to the power supply using the open_gpibusb method of the HPe3631a class, specifying the device path (/dev/ttyUSB0) and the GPIB address (10).

Next, it sets the channel to P25V by accessing the channel property of the power supply object and indexing it with 2.

Then, it sets the output voltage to 12.5V by assigning the desired voltage to the voltage property of the power supply object.

Finally, it reads back the set voltage by accessing the voltage property and prints it. It also reads back the sensed voltage by accessing the voltage_sense property and prints it.