Skip to content

Connecting to Keysight 33120A by HP in Python

Instrument Card

33120A Function / Arbitrary Waveform Generator, 15 MHz

Keysight 33120A

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 33120A in Python

PROTOCOLS > SCPI

from pymeasure.adapters import VISAAdapter
from pymeasure.instruments import HP33120A
# Create a VISA adapter for communication
adapter = VISAAdapter("GPIB0::10::INSTR")
# Connect to the Keysight 33120A Function Generator
generator = HP33120A(adapter)
# Set the waveform shape to sinusoid
generator.shape = 'sinusoid'
# Set the frequency to 1 kHz
generator.frequency = 1000
# Set the amplitude to 1 Vpp
generator.amplitude = 1
# Enable the output
generator.output = True
# Generate a system beep
generator.beep()
# Disconnect from the instrument
generator.disconnect()

This script first creates a VISA adapter using the VISAAdapter class from Pymeasure. The adapter is initialized with the VISA address of the instrument, which in this case is “GPIB0::10::INSTR”.

Then, an instance of the HP33120A class is created, passing the adapter as an argument. This represents the Keysight 33120A Function Generator.

The script then sets the waveform shape to sinusoid, frequency to 1 kHz, and amplitude to 1 Vpp using the properties provided by the HP33120A class.

Next, the output of the function generator is enabled by setting the output property to True.

A system beep is generated using the beep() method of the function generator.

Finally, the script disconnects from the instrument using the disconnect() method.

Note: Make sure to install the necessary dependencies (pymeasure, pyvisa, etc.) before running the script.