Connecting to Keysight 8722ES by Agilent in Python
Instrument Card
The Agilent 8722ES Vector Network Analyzer (VNA) allows users to test a RF device’s amplitude and phase with one instrument. It works within 50 MHz to 40 GHz and enables the complete characterization of a device or network.
Device Specification: here
Manufacturer card: 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 8722ES in Python
Read our guide for turning Python scripts into Flojoy nodes.
PROTOCOLS > SCPI
from pymeasure.instruments import visafrom pymeasure.instruments.agilent import Agilent8722ES
# Connect to the instrumentresource_manager = visa.ResourceManager()instrument = Agilent8722ES(resource_manager.open_resource('GPIB0::1::INSTR'))
# Set the start and stop frequenciesinstrument.start_frequency = 1e6 # 1 MHzinstrument.stop_frequency = 1e9 # 1 GHz
# Set the number of scan pointsinstrument.scan_points = 101
# Perform a single scaninstrument.scan_single()
# Get the frequencies and data from the scanfrequencies = instrument.frequenciesdata_magnitude = instrument.data_magnitudedata_phase = instrument.data_phase
# Print the frequencies and datafor frequency, magnitude, phase in zip(frequencies, data_magnitude, data_phase): print(f"Frequency: {frequency} Hz, Magnitude: {magnitude} dB, Phase: {phase} degrees")
# Disconnect from the instrumentinstrument.disconnect()
This script connects to the instrument using the VISA library, sets the start and stop frequencies, and performs a single scan. It then retrieves the frequencies, magnitude, and phase data from the scan and prints them out. Finally, it disconnects from the instrument.
Note: Make sure to install the necessary dependencies (pymeasure
, pyvisa
, and numpy
) before running the script.