Skip to content

Connecting to Keysight N5232B by Keysight in Python

Instrument Card

The Keysight N5232B PNA-L series network analyzer is designed for S-parameter and simple nonlinear testing of passive components, amplifiers, and frequency converters. With the same core firmware as the PNA, the PNA-L offers the perfect balance of value and performance. The PNA-L provides efficiency and flexibility in both manufacturing and R&D applications, for industries ranging from mobile-telecomm and wireless-LAN component production to aerospace and defense.

Keysight N5232B

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 N5232B in Python

PROTOCOLS > SCPI

from qcodes import Station
from qcodes.instrument_drivers.Keysight.Keysight_P9372A import Keysight_P9372A
# Create a station to hold the instruments
station = Station()
# Connect to the Keysight N5232B Network Analyzer
na = Keysight_P9372A('na', 'TCPIP0::192.168.1.1::inst0::INSTR')
station.add_component(na)
# Print the available options on the Network Analyzer
print(na.get_options())
# Set the frequency range
na.start(1e9)
na.stop(10e9)
# Set the power range
na._set_power_limits(-30, 10)
# Enable trace averaging
na.averages_on()
# Set the number of averages
na.averages(10)
# Set the IF bandwidth
na.if_bandwidth(1e3)
# Set the number of points in a sweep
na.points(1001)
# Set the electrical delay
na.electrical_delay(0)
# Set the sweep mode to continuous
na.sweep_mode('CONT')
# Set the trigger source to external
na.trigger_source('EXT')
# Select the active trace
na.active_trace(1)
# Run a sweep on the Network Analyzer
na.run_sweep()
# Get the data from the active trace
data = na.traces[0].get()
# Print the data
print(data)

Note: The above code assumes that the IP address of the Keysight N5232B Network Analyzer is 192.168.1.1. Please replace it with the correct IP address of your instrument.