Skip to content

Connecting to Keysight M960x defs by Keysight in Python

Instrument Card

PXI source/measure units are the source and measurement resources of voltage and current for test applications requiring high accuracy, high resolution, and measurement flexibility

Keysight M960x defs

Device Specification: here

Manufacturer card: KEYSIGHT

KEYSIGHT

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 M960x defs in Python

PROTOCOLS > SCPI

Here is a Python script that uses Qcodes to connect to a Keysight M960x Power Meter:

import qcodes as qc
from qcodes.instrument_drivers.Keysight.Keysight_M960x import Keysight_M960x
# Connect to the power meter
power_meter = Keysight_M960x("power_meter", "TCPIP0::192.168.1.1::inst0::INSTR")
# Print the power meter identification
print(power_meter.idn())
# Set the power meter to measure power
power_meter.measurement_function("POWER")
# Set the power meter range
power_meter.range_auto(True)
# Read the power measurement
power = power_meter.power()
# Print the power measurement
print(f"Power: {power} dBm")
# Close the connection to the power meter
power_meter.close()

This script connects to the power meter using the IP address “192.168.1.1” and sets up the measurement function to measure power. It then reads the power measurement and prints the result. Finally, it closes the connection to the power meter.