Skip to content

Connecting to Keysight N5171B EXG by Keysight in Python

Instrument Card

N5171B EXG X-Series RF analog mid-performance signal generators offer 9 kHz to 6 GHz frequency coverage, optimized for manufacturing with faster throughput and greater uptime at the right price.

Keysight N5171B EXG

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 N5171B EXG in Python

PROTOCOLS > SCPI

from qcodes import Station, Instrument
from qcodes.instrument_drivers.Keysight.N51x1 import N51x1
# Create a station to hold the instrument
station = Station()
# Connect to the Keysight N5171B EXG RF Signal Generator
n5171b = N51x1('n5171b', 'TCPIP0::192.168.1.1::inst0::INSTR')
# Add the instrument to the station
station.add_component(n5171b)
# Print the IDN information of the instrument
print(n5171b.get_idn())
# Set the frequency to 1 GHz
n5171b.frequency(1e9)
# Set the power to -10 dBm
n5171b.power(-10)
# Enable the RF output
n5171b.rf_output(1)
# Disable the pulse modulation
n5171b.pulse_modulation(0)
# Disconnect from the instrument
n5171b.close()

This script connects to a Keysight N5171B EXG RF Signal Generator using the Qcodes driver N51x1. It creates a station to hold the instrument, connects to the instrument using the instrument’s IP address, adds the instrument to the station, and then performs various operations on the instrument such as setting the frequency, power, enabling RF output, and disabling pulse modulation. Finally, it closes the connection to the instrument.