Skip to content

Connecting to Keysight MAwgDef by Keysight in Python

Instrument Card

Device Specification: here

Manufacturer card: 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 MAwgDef in Python

PROTOCOLS > SCPI

To connect to a Keysight MAwgDef RF Signal Generator using Qcodes, you can use the following Python script:

import qcodes as qc
from qcodes.instrument_drivers.Keysight.Keysight_MAwgDef import Keysight_MAwgDef
# Connect to the instrument
mawg = Keysight_MAwgDef('mawg', 'TCPIP0::192.168.1.1::inst0::INSTR')
# Print the instrument ID
print(mawg.idn())
# Set the output frequency to 1 GHz
mawg.frequency(1e9)
# Set the output power to -10 dBm
mawg.power(-10)
# Enable the output
mawg.output(True)
# Disconnect from the instrument
mawg.close()

This script imports the necessary modules and creates an instance of the Keysight_MAwgDef instrument driver. It then connects to the instrument using the specified VISA address. You can replace 'TCPIP0::192.168.1.1::inst0::INSTR' with the actual VISA address of your instrument.

The script then demonstrates some basic operations such as printing the instrument ID, setting the output frequency and power, enabling the output, and finally disconnecting from the instrument.

Note: Make sure you have installed the necessary dependencies and the Qcodes library before running this script.