Skip to content

Connecting to Keysight 8657B by HP in Python

Instrument Card

The Agilent Technologies 8657A and 8657B signal generators are designed to test AM, FM, and pulsed receivers as well as components.

Keysight 8657B

Device Specification: here

Manufacturer card: HP

HP

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 8657B in Python

PROTOCOLS > SCPI

Here is a Python script that uses Pymeasure to connect to a Keysight 8657B RF Signal Generator:

from pymeasure.adapters import VISAAdapter
from pymeasure.instruments.hp import HP8657B
# Create a VISA adapter for the instrument
adapter = VISAAdapter("GPIB::7")
# Connect to the instrument
instrument = HP8657B(adapter)
# Set the output frequency to 1 MHz
instrument.frequency = 1E6
# Set the output level to -10 dBm
instrument.level = -10
# Enable the output
instrument.output_enabled = True
# Disconnect from the instrument
instrument.shutdown()

Explanation of the code:

  1. Import the necessary modules from Pymeasure.
  2. Create a VISAAdapter object with the appropriate address for the instrument.
  3. Create an HP8657B object with the adapter.
  4. Use the frequency property to set the output frequency of the instrument.
  5. Use the level property to set the output level of the instrument.
  6. Use the output_enabled property to enable the output of the instrument.
  7. Use the shutdown method to disconnect from the instrument.