Skip to content

Connecting to Keysight 5222B by Keysight in Python

Instrument Card

The Keysight N5222B PNA Microwave Network Analyzer 10 MHz to 26.5 GHz is an integrated and flexible test engine that can measure active devices such as amplifiers, mixers, and frequency converters. This analyzer operates at a frequency range of 900 Hz to 26.5 GHz. The Keysight N5222B provides a combination of excellent hardware and powerful measurement applications to measure a broad range of devices quickly and accurately.

Keysight 5222B

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

Connect to the Keysight 5222B in Python

PROTOCOLS > SCPI

To connect to a Keysight 5222B Network Analyzer using Qcodes, you can use the following Python script:

from qcodes import Station
from qcodes.instrument_drivers.Keysight.Keysight_5222B import Keysight_5222B
# Create a station to hold the instruments
station = Station()
# Connect to the Keysight 5222B Network Analyzer
na = Keysight_5222B('na', 'TCPIP0::192.168.1.1::inst0::INSTR')
station.add_component(na)
# Now you can use the `na` object to control the network analyzer
# For example, you can set the start and stop frequencies
na.start(1e6) # Set the start frequency to 1 MHz
na.stop(1e9) # Set the stop frequency to 1 GHz
# You can also read measurements from the network analyzer
data = na.traces[0].magnitude() # Read the magnitude of the first trace
# Print the data
print(data)
# Close the connection to the network analyzer
na.close()

Note: Replace 'TCPIP0::192.168.1.1::inst0::INSTR' with the actual IP address or VISA resource string of your Keysight 5222B Network Analyzer.