Skip to content

Connecting to Keysight 4156C by Agilent in Python

Instrument Card

4156C Precision Semiconductor Parameter Analyzer

Keysight 4156C

Device Specification: here

Manufacturer card: AGILENT

AGILENT

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

Connect to the Keysight 4156C in Python

PROTOCOLS > SCPI

from pymeasure.instruments.agilent import Agilent4156
# Connect to the instrument
instrument = Agilent4156("GPIB0::25")
# Reset the instrument
instrument.reset()
# Configure the instrument using a JSON configuration file
instrument.configure("configuration_file.json")
# Save the desired data variables
instrument.save(['VC', 'IC', 'VB', 'IB'])
# Perform a measurement
instrument.measure()
# Get the measured data as a pandas DataFrame
data = instrument.get_data()
# Print the data
print(data)

In this example, you would need to replace "GPIB0::25" with the appropriate address of your Keysight 4156C Spectrum Analyzer. You would also need to provide a valid JSON configuration file for the configure method.

The script connects to the instrument, resets it, configures it using the JSON file, saves the desired data variables, performs a measurement, and retrieves the measured data as a pandas DataFrame. Finally, it prints the data.

Note that you may need to install the pandas library if it’s not already installed. You can do this by running pip install pandas in your terminal.