Skip to content

Connecting to MS9710C by Anritsu in Python

Instrument Card

The MS9710C provides excellent wavelength accuracy, waveform shape, and new features

MS9710C

Device Specification: here

Manufacturer card: ANRITSU

ANRITSU

Anritsu Has Testing Solutions for Automotive, Government, Data Center, & IoT Industries. Test Solutions for IoT Devices, Government Radar, Automotive, & Signal Integrity.

  • Headquarters: JAPAN
  • Yearly Revenue (millions, USD): 670
  • Vendor Website: here

Connect to the MS9710C in Python

PROTOCOLS > SCPI

from pymeasure.instruments.anritsu import AnritsuMS9710C
# Connect to the Spectrum Analyzer
spectrum_analyzer = AnritsuMS9710C("TCPIP::192.168.1.1::INSTR")
# Perform a single sweep and wait for completion
spectrum_analyzer.single_sweep()
# Measure the peak and get the trace marker
peak = spectrum_analyzer.measure_peak()
print("Peak:", peak)
# Read the scan saved in memory slot A
wavelengths, power = spectrum_analyzer.read_memory(slot="A")
print("Wavelengths:", wavelengths)
print("Power:", power)
# Disconnect from the Spectrum Analyzer
spectrum_analyzer.disconnect()

In this script, we first import the AnritsuMS9710C class from pymeasure.instruments.anritsu. Then, we create an instance of the AnritsuMS9710C class by providing the instrument’s address (e.g., "TCPIP::192.168.1.1::INSTR").

Next, we perform a single sweep using the single_sweep() method of the spectrum analyzer. This method sends the command to initiate a spectrum sweep and waits for the sweep to complete.

After that, we use the measure_peak() method to measure the peak of the spectrum and get the trace marker. The method sets the peak search mode to “PEAK” and returns the wavelength and power of the peak.

Finally, we read the scan saved in memory slot A using the read_memory() method. This method retrieves the wavelength and power values from the memory slot and returns them as numpy arrays.

Note: Make sure to replace "TCPIP::192.168.1.1::INSTR" with the actual address of your Anritsu MS9710C Spectrum Analyzer.