Connecting to Keysight 33220A by Agilent in Python
Instrument Card
The Keysight 33220A is a 20 MHz synthesized function generator with built-in arbitrary waveform and pulse capabilities. Itscombination of bench-top and system features makes this function generator a versatile solution for your testing requirements now and in the future.
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 33220A in Python
Read our guide for turning Python scripts into Flojoy nodes.
PROTOCOLS > SCPI
from instrumentkit import Instrument, SCPIInstrument
# Define the SCPI commands for the Keysight 33220A RF Signal Generatorclass Keysight33220A(SCPIInstrument): def __init__(self, resource_name): super().__init__(resource_name)
def set_frequency(self, frequency): self.send_command(f"FREQ {frequency}")
def set_amplitude(self, amplitude): self.send_command(f"VOLT {amplitude}")
def enable_output(self): self.send_command("OUTP ON")
def disable_output(self): self.send_command("OUTP OFF")
# Connect to the Keysight 33220A RF Signal Generatorsignal_generator = Keysight33220A("TCPIP0::192.168.1.1::INSTR")
# Set the frequency to 1 MHzsignal_generator.set_frequency(1e6)
# Set the amplitude to 1 Vppsignal_generator.set_amplitude(1)
# Enable the outputsignal_generator.enable_output()
# Disable the output after 5 secondstime.sleep(5)signal_generator.disable_output()
# Disconnect from the signal generatorsignal_generator.disconnect()
Make sure to replace "TCPIP0::192.168.1.1::INSTR"
with the actual resource name or address of your Keysight 33220A RF Signal Generator.