Skip to content

Connecting to Rigol DS4000-Series by Rigol in Python

Instrument Card

The Rigol DS4000 series consists of 8 high level Oscilloscopes for professional operation, which come off very well compared to higher prices models of other brands.

Rigol DS4000-Series

Device Specification: here

Manufacturer card: RIGOL

RIGOL

RIGOL Technologies, Inc. specializes in development and production of test and measuring equipment and is one of the fastest growing Chinese companies in this sphere. RIGOL’s line of products includes digital storage oscilloscopes, function/arbitrary waveform generators, digital multimeters, PC-based devices compatible with LXI standard etc.

  • Headquarters: Beijing, China
  • Yearly Revenue (millions, USD): 23
  • Vendor Website: here

Demo: Measure signal width and phase with a Tektronix oscilloscope

Connect to the Rigol DS4000-Series in Python

PROTOCOLS > SCPI

To connect to a Rigol DS4000-Series Oscilloscope using Qcodes, you can use the following Python script:

import qcodes as qc
from qcodes.instrument_drivers.rigol.DS4000 import RigolDS4000
# Connect to the oscilloscope
oscilloscope = RigolDS4000("oscilloscope", "USB0::0x1AB1::0x04CE::DS4A203100839::INSTR")
# Print the IDN information of the oscilloscope
print(oscilloscope.get_idn())
# Set the time base to 1 ms/div
oscilloscope.time_base(0.001)
# Enable autoscale
oscilloscope.enable_auto_scale(True)
# Start acquisition
oscilloscope.run()
# Wait for the acquisition to complete
qc.WaitInterval(1).wait()
# Stop acquisition
oscilloscope.stop()
# Get the waveform data from channel 1
waveform_data = oscilloscope.channels.ch1.curvedata()
# Print the waveform data
print(waveform_data)
# Disconnect from the oscilloscope
oscilloscope.close()

This script connects to the oscilloscope using the VISA address “USB0::0x1AB1::0x04CE::DS4A203100839::INSTR”. You may need to modify this address to match the actual address of your oscilloscope.

The script then performs various operations on the oscilloscope, such as setting the time base, enabling autoscale, starting and stopping the acquisition, and retrieving the waveform data from channel 1.

Finally, the script closes the connection to the oscilloscope using the close() method.

Note: This script assumes that you have already installed the necessary dependencies, including Qcodes and the Rigol DS4000 driver.