Skip to content

Oscilloscopes

Auto-generated from driver source.


Rigol DHO804

4-channel 70 MHz digital oscilloscope.

Rigol_DHO804

Bases: DeviceManager

Driver for Rigol DHO804 4-channel digital oscilloscope.

Uses standard SCPI commands over USB-TMC/VISA.

connect

connect()

Connect to the Rigol DHO804 oscilloscope.

disconnect

disconnect()

Disconnect from the oscilloscope.

enable_channel

enable_channel(channel: int)

Enable a channel.

disable_channel

disable_channel(channel: int)

Disable a channel.

set_vertical_scale

set_vertical_scale(channel: int, volts_per_div: float, offset: float = 0.0)

Set vertical scale and offset for a channel.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
volts_per_div float

Vertical scale in volts per division

required
offset float

Vertical offset in volts

0.0

set_coupling

set_coupling(channel: int, coupling: str)

Set channel coupling.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
coupling str

'DC', 'AC', or 'GND'

required

set_bandwidth_limit

set_bandwidth_limit(channel: int, limit: str) -> None

Set bandwidth limit for a channel.

Reference: pdf_chapters/3.6.1_CHANnel_n__BWLimit.pdf

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
limit str

'20M' for 20MHz limit, 'OFF' to disable

required
Notes

Bandwidth limiting reduces noise and high-frequency components. Useful for cleaner signal display and measurements.

Raises:

Type Description
ValueError

If channel or limit is invalid

VisaIOError

If communication fails

invert_channel

invert_channel(channel: int, enable: bool) -> None

Invert the waveform display.

Reference: pdf_chapters/3.6.4_CHANnel_n__INVert.pdf

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
enable bool

True to invert waveform, False for normal display

required
Notes

When enabled, voltage values are inverted (flipped vertically). Useful for comparing signals or viewing negative logic.

Raises:

Type Description
ValueError

If channel is invalid

VisaIOError

If communication fails

set_probe_ratio

set_probe_ratio(channel: int, ratio: float) -> None

Set probe attenuation ratio.

Reference: pdf_chapters/3.6.8_CHANnel_n__PROBe.pdf

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
ratio float

Probe attenuation ratio Common values: 1, 10, 100, 1000 Valid: 0.001, 0.002, 0.005, 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000

required
Notes
  • Display amplitude = Actual amplitude × Probe ratio
  • 1X probe: Direct connection (ratio = 1)
  • 10X probe: 10:1 attenuation (ratio = 10)
  • 100X probe: 100:1 attenuation (ratio = 100)
  • Probe ratio affects vertical scale range

Raises:

Type Description
ValueError

If channel or ratio is invalid

VisaIOError

If communication fails

set_probe_attenuation

set_probe_attenuation(channel: int, ratio: float) -> None

Alias for set_probe_ratio.

set_channel_position

set_channel_position(channel: int, position: float) -> None

Set vertical position (bias voltage) of the channel.

Reference: pdf_chapters/3.6.13_CHANnel_n__POSition.pdf

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
position float

Vertical position offset in volts Moves waveform up (positive) or down (negative)

required
Notes
  • Adjusts where the waveform appears vertically on screen
  • Does not affect actual signal or measurements
  • Useful for separating multiple waveforms

Raises:

Type Description
ValueError

If channel is invalid

VisaIOError

If communication fails

get_channel_position

get_channel_position(channel: int) -> float

Get vertical position (bias voltage) of the channel.

Reference: pdf_chapters/3.6.13_CHANnel_n__POSition.pdf

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required

Returns:

Name Type Description
float float

Current vertical position offset in volts

Raises:

Type Description
ValueError

If channel is invalid

VisaIOError

If communication fails

set_vertical_position

set_vertical_position(channel: int, position: float) -> None

Alias for set_channel_position for API compatibility.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
position float

Vertical position offset in volts

required

get_vertical_position

get_vertical_position(channel: int) -> float

Alias for get_channel_position for API compatibility.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required

Returns:

Name Type Description
float float

Current vertical position offset in volts

move_vertical

move_vertical(channel: int, delta: float) -> None

Move a channel vertically by a delta amount.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
delta float

Amount to move in volts (positive = up, negative = down)

required

Raises:

Type Description
ValueError

If channel is invalid

VisaIOError

If communication fails

set_channel_label

set_channel_label(channel: int, label: str, show: bool = True) -> None

Set channel label text and visibility.

Reference
  • pdf_chapters/3.6.9_CHANnel_n__LABel_SHOW.pdf
  • pdf_chapters/3.6.10_CHANnel_n__LABel_CONTent.pdf

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
label str

Label text to display

required
show bool

True to show label, False to hide

True
Notes

Labels appear on the waveform display for easy identification. Useful for marking signals in multi-channel setups.

Raises:

Type Description
ValueError

If channel is invalid

VisaIOError

If communication fails

set_vernier

set_vernier(channel: int, enable: bool) -> None

Enable/disable fine vertical scale adjustment.

Reference: pdf_chapters/3.6.12_CHANnel_n__VERNier.pdf

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
enable bool

True for fine adjustment, False for coarse (1-2-5 steps)

required
Notes

When enabled, allows finer control of vertical scale between standard 1-2-5 sequence steps. Improves vertical resolution for viewing waveform details.

Raises:

Type Description
ValueError

If channel is invalid

VisaIOError

If communication fails

set_horizontal_scale

set_horizontal_scale(seconds_per_div: float) -> None

Set horizontal timebase scale.

Reference: pdf_chapters/3.26.5_TIMebase[_MAIN]_SCALe.pdf

Parameters:

Name Type Description Default
seconds_per_div float

Time per division in seconds Common values: 1ns to 1000s (1-2-5 sequence)

required

Raises:

Type Description
VisaIOError

If communication fails

set_horizontal_offset

set_horizontal_offset(offset: float) -> None

Set horizontal offset (time position).

Reference: pdf_chapters/3.26.4_TIMebase[_MAIN][_OFFSet].pdf

Parameters:

Name Type Description Default
offset float

Time offset in seconds Negative = waveform shifts left (earlier time visible) Positive = waveform shifts right (later time visible) Zero = trigger point at center

required
Notes

Offset range depends on timebase scale and memory depth.

Raises:

Type Description
VisaIOError

If communication fails

set_timebase_mode

set_timebase_mode(mode: str) -> None

Set horizontal timebase mode.

Reference: pdf_chapters/3.26.6_TIMebase_MODE.pdf

Parameters:

Name Type Description Default
mode str

'MAIN' (YT mode - voltage vs time, default) 'XY' (XY mode - voltage vs voltage) 'ROLL' (roll mode - continuous scrolling)

required
Notes
  • MAIN/YT: Standard oscilloscope display (Y=voltage, X=time)
  • XY: Phase measurement mode (both axes show voltage)
  • ROLL: Auto-enabled at timebase ≥50ms/div Waveform scrolls right to left continuously Trigger disabled in ROLL mode

Raises:

Type Description
ValueError

If mode is invalid

VisaIOError

If communication fails

enable_delayed_timebase

enable_delayed_timebase(enable: bool) -> None

Enable/disable delayed (zoom) timebase.

Reference: pdf_chapters/3.26.1_TIMebase_DELay_ENABle.pdf

Parameters:

Name Type Description Default
enable bool

True to enable zoom window, False to disable

required
Notes

Delayed sweep (zoom) allows you to magnify a portion of the main waveform for detailed viewing. Use set_delayed_scale() and set_delayed_offset() to control the zoom window.

Raises:

Type Description
VisaIOError

If communication fails

set_delayed_offset

set_delayed_offset(offset: float) -> None

Set delayed timebase offset (zoom window position).

Reference: pdf_chapters/3.26.2_TIMebase_DELay_OFFSet.pdf

Parameters:

Name Type Description Default
offset float

Position of zoom window in seconds

required
Notes

Controls where the zoomed region appears on the main waveform. Range formula: - LeftTime = 5 × MainScale - MainOffset - RightTime = 5 × MainScale + MainOffset - DelayRange = 10 × DelayScale - Range: -(LeftTime - DelayRange/2) to (RightTime - DelayRange/2)

Raises:

Type Description
VisaIOError

If communication fails

set_delayed_scale

set_delayed_scale(scale: float) -> None

Set delayed timebase scale (zoom level).

Reference: pdf_chapters/3.26.3_TIMebase_DELay_SCALe.pdf

Parameters:

Name Type Description Default
scale float

Time per division for zoom window (seconds) Must be ≤ current main timebase scale Uses 1-2-5 step sequence

required
Notes

Smaller scale = higher magnification (more zoom). Maximum value is the current main timebase scale.

Raises:

Type Description
VisaIOError

If communication fails

enable_xy_mode

enable_xy_mode(enable: bool = True, x_channel: int = 1, y_channel: int = 2) -> None

Enable/disable XY display mode.

Reference: pdf_chapters/3.26.12_TIMebase_XY_ENABle.pdf

Parameters:

Name Type Description Default
enable bool

True to enable XY mode, False for normal time display

True
x_channel int

Channel for X axis (1-4), only used when enabling

1
y_channel int

Channel for Y axis (1-4), only used when enabling

2
Notes

XY mode displays voltage vs voltage (instead of voltage vs time). Useful for: - Phase measurements (Lissajous patterns) - Transfer function analysis - Frequency comparison

X and Y channel assignments require separate commands if needed. See :TIMebase:XY:X and :TIMebase:XY:Y commands.

Raises:

Type Description
ValueError

If channel numbers are invalid

VisaIOError

If communication fails

configure_trigger

configure_trigger(channel: int, level: float, slope: str = 'RISE', mode: str = 'AUTO')

Configure edge trigger.

Parameters:

Name Type Description Default
channel int

Trigger source channel (1-4)

required
level float

Trigger level in volts

required
slope str

'RISE' (POSitive), 'FALL' (NEGative), or 'RFALL'

'RISE'
mode str

Trigger mode (not directly settable via simple command, scope uses sweep mode)

'AUTO'

set_trigger_sweep

set_trigger_sweep(sweep: str) -> None

Set trigger sweep mode.

Reference: pdf_chapters/3.27.4_TRIGger_SWEep.pdf

Parameters:

Name Type Description Default
sweep str

Trigger sweep mode 'AUTO' - Auto trigger, always displays waveforms 'NORMal' - Normal trigger, only when conditions met 'SINGle' - Single trigger, one acquisition then stop

required
Notes
  • AUTO: Waveforms displayed regardless of trigger conditions
  • NORMal: Only displays when triggered, waits otherwise
  • SINGle: Same as single() method, one shot acquisition

Raises:

Type Description
ValueError

If sweep mode is invalid

VisaIOError

If communication fails

set_trigger_coupling

set_trigger_coupling(coupling: str) -> None

Set trigger coupling type.

Reference: pdf_chapters/3.27.2_TRIGger_COUPling.pdf

Parameters:

Name Type Description Default
coupling str

Trigger coupling type 'DC' - DC and AC components pass (default) 'AC' - Blocks DC components 'LFReject' - Rejects low frequency components 'HFReject' - Rejects high frequency components

required
Notes
  • Only available for Edge trigger with analog channel source
  • AC coupling blocks DC offset
  • LF reject blocks DC and low frequencies
  • HF reject attenuates high frequencies

Raises:

Type Description
ValueError

If coupling type is invalid

VisaIOError

If communication fails

set_trigger_holdoff

set_trigger_holdoff(time: float) -> None

Set trigger holdoff time.

Reference: pdf_chapters/3.27.5_TRIGger_HOLDoff.pdf

Parameters:

Name Type Description Default
time float

Holdoff time in seconds (8ns to 10s) Oscilloscope ignores triggers during holdoff period

required
Notes
  • Useful for stable triggering on complex waveforms (e.g., pulse trains)
  • Oscilloscope waits for holdoff time before re-arming trigger
  • Not available for: Video, Timeout, Setup&Hold, Nth Edge, and serial protocol triggers (RS232, I2C, SPI, CAN, LIN)

Raises:

Type Description
ValueError

If time is out of range

VisaIOError

If communication fails

get_trigger_status

get_trigger_status() -> str

Query current trigger status.

Reference: pdf_chapters/3.27.3_TRIGger_STATus_.pdf

Returns:

Name Type Description
str str

Trigger status 'TD' - Triggered 'WAIT' - Waiting for trigger 'RUN' - Running (AUTO mode, no trigger) 'AUTO' - Auto trigger 'STOP' - Stopped

Raises:

Type Description
VisaIOError

If communication fails

configure_pulse_trigger

configure_pulse_trigger(source: int, polarity: str, when: str, width_lower: float, width_upper: float = None, level: float = 0.0) -> None

Configure pulse width trigger.

Reference: pdf_chapters/3.27.9_TRIGger_PULSe.pdf

Triggers on positive or negative pulses of specified width. Positive pulse width is time between two trigger level crossings on positive pulse. Negative pulse width is for negative pulse.

Parameters:

Name Type Description Default
source int

Trigger source channel (1-4)

required
polarity str

Pulse polarity 'POSitive' - Positive pulses 'NEGative' - Negative pulses

required
when str

Width condition 'GREater' - Pulse width > lower limit 'LESS' - Pulse width < upper limit 'GLESs' - Lower limit < pulse width < upper limit

required
width_lower float

Lower width limit in seconds (1ns minimum)

required
width_upper float

Upper width limit in seconds (required for LESS/GLESs)

None
level float

Trigger level in volts (default 0.0)

0.0
Notes
  • GREater: width > width_lower
  • LESS: width < width_upper
  • GLESs: width_lower < width < width_upper

Raises:

Type Description
ValueError

If parameters are invalid

VisaIOError

If communication fails

configure_timeout_trigger

configure_timeout_trigger(source: int, slope: str, timeout: float, level: float = 0.0) -> None

Configure timeout trigger.

Reference: pdf_chapters/3.27.14_TRIGger_TIMeout.pdf

Triggers when time interval between edges exceeds timeout value. The interval (ΔT) is from when one edge passes through trigger level to when the opposite edge passes through trigger level.

Parameters:

Name Type Description Default
source int

Trigger source channel (1-4)

required
slope str

Edge type to start timing 'POSitive' - Start on rising edge 'NEGative' - Start on falling edge 'RFALl' - Start on either edge

required
timeout float

Timeout period in seconds (1ns to 10s)

required
level float

Trigger level in volts (default 0.0)

0.0
Notes
  • POSitive: Times from rising edge to next falling edge
  • NEGative: Times from falling edge to next rising edge
  • RFALl: Times from any edge to next opposite edge
  • Triggers when ΔT > timeout value

Raises:

Type Description
ValueError

If parameters are invalid

VisaIOError

If communication fails

clear

clear() -> None

Clear all waveforms on the screen.

Reference: pdf_chapters/3.1.1_CLEar.pdf

This command functions the same as the front-panel CLEAR key. Clears all displayed waveforms without affecting instrument settings.

Raises:

Type Description
VisaIOError

If communication fails

run

run() -> None

Start running the oscilloscope (continuous acquisition).

Reference: pdf_chapters/3.1.2_RUN.pdf

Starts the oscilloscope in continuous acquisition mode. The scope will continuously acquire and display waveforms based on the current trigger settings.

This command functions the same as the RUN button on the front panel.

Raises:

Type Description
VisaIOError

If communication fails

stop

stop() -> None

Stop the oscilloscope acquisition.

Reference: pdf_chapters/3.1.3_STOP.pdf

Stops the oscilloscope from acquiring new waveforms. The current waveform remains displayed on screen and can be analyzed.

This command functions the same as the STOP button on the front panel.

Raises:

Type Description
VisaIOError

If communication fails

single

single() -> None

Set oscilloscope to single trigger mode and arm for one acquisition.

Reference: pdf_chapters/3.1.4_SINGle.pdf

Sets the trigger mode to "Single" and arms the oscilloscope. The scope will wait for a trigger event, capture one waveform when triggered, then stop.

This command is equivalent to :TRIGger:SWEep SINGle and functions the same as the SINGLE button on the front panel.

Notes
  • In single trigger mode, the oscilloscope performs a single trigger when conditions are met and then stops
  • Invalid when waveform recording is enabled or during playback
  • Use force_trigger() to generate a trigger by force in single mode

Raises:

Type Description
VisaIOError

If communication fails

wait_for_stop

wait_for_stop(timeout: float = 10.0) -> bool

Poll trigger status until the scope stops (TD or STOP state).

Call after single() to block until the trigger fires and the scope has captured and frozen the waveform. Returns True if the scope stopped within the timeout, False if the timeout expired while the scope was still armed (WAIT state).

Parameters:

Name Type Description Default
timeout float

Maximum seconds to wait (default 10.0)

10.0

Returns:

Name Type Description
bool bool

True if scope stopped (trigger fired), False if timed out

force_trigger

force_trigger() -> None

Generate a trigger signal forcefully.

Reference: pdf_chapters/3.1.5_TFORce.pdf

Forces a trigger event regardless of the actual trigger conditions. This command is only applicable in NORMAL and SINGLE trigger modes (not AUTO mode).

This command functions the same as the FORCE button in the trigger control area of the front panel.

Notes
  • Only works in NORMAL or SINGLE trigger sweep modes
  • Useful for capturing one-shot events or testing
  • See :TRIGger:SWEep command for sweep mode settings

Raises:

Type Description
VisaIOError

If communication fails

set_waveform_source

set_waveform_source(source: str) -> None

Set source channel for waveform data acquisition.

Reference: pdf_chapters/3.28.1_WAVeform_SOURce.pdf

Parameters:

Name Type Description Default
source str

Source channel 'CHAN1', 'CHAN2', 'CHAN3', 'CHAN4' - Analog channels 'MATH1', 'MATH2', 'MATH3', 'MATH4' - Math waveforms For DHO900: 'D0' through 'D15' - Digital channels

required
Notes
  • When source is MATH1-MATH4, only NORMal mode is available
  • Digital channels only supported on DHO900 series

Raises:

Type Description
ValueError

If source is invalid

VisaIOError

If communication fails

set_waveform_mode

set_waveform_mode(mode: str) -> None

Set waveform data acquisition mode.

Reference: pdf_chapters/3.28.2_WAVeform_MODE.pdf

Parameters:

Name Type Description Default
mode str

Acquisition mode 'NORMal' - Screen data (~1000 points) 'MAXimum' - Screen when running, memory when stopped 'RAW' - Internal memory (only when stopped)

required
Notes
  • NORMAL: Fast, gets displayed waveform
  • MAXIMUM: Screen data when running, deep memory when stopped
  • RAW: Full internal memory, scope must be stopped
  • MATH sources only support NORMal mode

Raises:

Type Description
ValueError

If mode is invalid

VisaIOError

If communication fails

set_waveform_format

set_waveform_format(format: str) -> None

Set waveform data format.

Reference: pdf_chapters/3.28.3_WAVeform_FORMat.pdf

Parameters:

Name Type Description Default
format str

Data format 'BYTE' - 8-bit (fast, less precision) 'WORD' - 16-bit (slower, more precision) 'ASCii' - ASCII text (slow, human readable)

required
Notes
  • BYTE: Recommended for speed
  • WORD: Use for maximum precision
  • ASCii: Only for debugging/manual inspection

Raises:

Type Description
ValueError

If format is invalid

VisaIOError

If communication fails

get_waveform_preamble

get_waveform_preamble() -> dict

Get all waveform scaling parameters.

Reference: pdf_chapters/3.28.14_WAVeform_PREamble_.pdf

Returns:

Name Type Description
dict dict

Waveform parameters - format: 0 (BYTE), 1 (WORD), 2 (ASCii) - type: 0 (NORMal), 1 (MAXimum), 2 (RAW) - points: Number of data points - count: Average count (1 if not averaging) - xincrement: Time between samples (seconds) - xorigin: Time of first sample (seconds) - xreference: Reference time index - yincrement: Voltage per ADC count (volts) - yorigin: Voltage origin/offset (volts) - yreference: Reference ADC value

Notes
  • Returns 10 comma-separated values
  • Use for converting raw data to real units

Raises:

Type Description
VisaIOError

If communication fails

acquire_waveform

acquire_waveform(channel: int, mode: str = 'NORMAL') -> WaveformData

Acquire complete waveform with proper scaling.

High-level method that handles all steps of waveform acquisition: 1. Sets waveform source 2. Configures format and mode 3. Gets waveform data 4. Gets scaling parameters 5. Converts to real units 6. Returns WaveformData object

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
mode str

Acquisition mode 'NORMAL' - Screen data (~1000 points, fast) 'MAXIMUM' - Deep memory when stopped 'RAW' - Full internal memory (must be stopped)

'NORMAL'

Returns:

Type Description
WaveformData

WaveformData object with time and voltage arrays

Example

scope.stop() # For deep memory acquisition waveform = scope.acquire_waveform(1, mode='MAXIMUM') print(f"Captured {len(waveform)} points") waveform.plot()

Raises:

Type Description
ValueError

If channel or mode is invalid

VisaIOError

If communication fails

save_waveform_csv

save_waveform_csv(channel: int, filename: str, max_points: int | None = None, time_window: float | None = None) -> None

Save waveform from a single channel to a CSV file.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
filename str

Output CSV filename (e.g., 'data.csv')

required
max_points int | None

Maximum number of points to save. If None, saves all.

None
time_window float | None

Time window in seconds to save. If None, saves all. Takes the most recent (last) time_window seconds of data.

None
Example

scope.save_waveform_csv(1, 'ch1_data.csv') scope.save_waveform_csv(1, 'ch1_recent.csv', time_window=10)

Raises:

Type Description
ValueError

If channel is invalid

VisaIOError

If communication fails

save_waveforms_csv

save_waveforms_csv(channels: list, filename: str, max_points: int | None = None, time_window: float | None = None) -> None

Save waveforms from multiple channels to a single CSV file.

Parameters:

Name Type Description Default
channels list

List of channel numbers to capture (e.g., [1, 3])

required
filename str

Output CSV filename (e.g., 'data.csv')

required
max_points int | None

Maximum number of points to save. If None, saves all.

None
time_window float | None

Time window in seconds to save. If None, saves all. Takes the most recent (last) time_window seconds of data.

None
Example

scope.save_waveforms_csv([1, 3], 'multi_channel.csv') scope.save_waveforms_csv([1, 3], 'recent.csv', time_window=10)

Raises:

Type Description
ValueError

If any channel is invalid

VisaIOError

If communication fails

set_measure_source

set_measure_source(source: str) -> None

Set measurement source channel.

Reference: pdf_chapters/3.17.1_MEASure_SOURce.pdf

Parameters:

Name Type Description Default
source str

Source channel 'CHAN1', 'CHAN2', 'CHAN3', 'CHAN4' - Analog channels 'MATH1', 'MATH2', 'MATH3', 'MATH4' - Math waveforms

required

Raises:

Type Description
ValueError

If source is invalid

VisaIOError

If communication fails

measure

measure(channel: int, measurement_type: str) -> float

Measure any waveform parameter.

Reference: pdf_chapters/3.17.2_MEASure_ITEM.pdf

Comprehensive measurement method supporting all DHO804 measurement types.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
measurement_type str

Measurement parameter (case-insensitive):

Voltage Measurements: - 'VMAX' - Maximum voltage - 'VMIN' - Minimum voltage - 'VPP' - Peak-to-peak voltage - 'VTOP' - Top voltage level - 'VBASe' - Base voltage level - 'VAMP' - Amplitude - 'VAVG' - Average voltage - 'VRMS' - RMS voltage - 'VMID' - Mid-level voltage - 'VUPPer' - Upper voltage - 'VLOWer' - Lower voltage

Time Measurements: - 'PERiod' - Period - 'FREQuency' - Frequency - 'RTIMe' - Rise time (10%-90%) - 'FTIMe' - Fall time (90%-10%) - 'PWIDth' - Positive pulse width - 'NWIDth' - Negative pulse width

Duty Cycle: - 'PDUTy' - Positive duty cycle - 'NDUTy' - Negative duty cycle

Overshoot: - 'OVERshoot' - Overshoot percentage - 'PREShoot' - Preshoot percentage

Slew Rate: - 'PSLewrate' - Positive slew rate - 'NSLewrate' - Negative slew rate

Shape: - 'OVERshoot' - Overshoot percentage - 'PREShoot' - Preshoot percentage - 'PSLewrate' - Positive slew rate - 'NSLewrate' - Negative slew rate

Area: - 'MARea' - Waveform area - 'MPARea' - Period area

Additional Voltage: - 'ACRMs' - AC RMS voltage - 'VARiance' - Voltage variance - 'PVRMs' - Per-period RMS - 'TVMAX' - Time at voltage maximum - 'TVMIN' - Time at voltage minimum

Counts: - 'PPULses' - Positive pulse count - 'NPULses' - Negative pulse count - 'PEDGes' - Positive edge count - 'NEDGes' - Negative edge count

required

Returns:

Name Type Description
float float

Measurement value

Example

vpp = scope.measure(1, 'VPP') freq = scope.measure(1, 'FREQuency') risetime = scope.measure(1, 'RTIMe')

Raises:

Type Description
ValueError

If channel or measurement type is invalid

VisaIOError

If communication fails

configure_measurement

configure_measurement(channel: int, measurement_type: str) -> None

Configure a measurement slot without querying (call before scope single).

Writes :MEASure:ITEM to open the slot while the scope is in RUN/armed state, so the value is computed when the trigger fires. Query with measure() after capture.

clear_measurements

clear_measurements() -> None

Clear all measurement items from the display panel.

Sends :MEASure:CLEar to remove all configured measurement slots from the on-screen results panel. Use before taking a clean screenshot. The DSP-computed values remain available until the next acquisition.

measure_vpp

measure_vpp(channel: int) -> float

Measure peak-to-peak voltage.

measure_vrms

measure_vrms(channel: int) -> float

Measure RMS voltage.

measure_frequency

measure_frequency(channel: int) -> float

Measure frequency in Hz.

measure_period

measure_period(channel: int) -> float

Measure period in seconds.

measure_rise_time

measure_rise_time(channel: int) -> float

Measure rise time (10% to 90%).

measure_fall_time

measure_fall_time(channel: int) -> float

Measure fall time (90% to 10%).

measure_duty_cycle

measure_duty_cycle(channel: int) -> float

Measure positive duty cycle percentage.

measure_amplitude

measure_amplitude(channel: int) -> float

Measure amplitude (Vtop - Vbase).

measure_bnf

measure_bnf(channel: int, measurement_type: str) -> float

Measure a parameter (alias for compatibility with existing REPL code). BNF = "Built-iN Function" measurement.

measure_delay

measure_delay(ch1: int, ch2: int, edge1: str = 'RISE', edge2: str = 'RISE') -> float

Measure delay between two channels.

Parameters:

Name Type Description Default
ch1 int

First channel (1-4)

required
ch2 int

Second channel (1-4)

required
edge1 str

Edge type for ch1 ('RISE' or 'FALL')

'RISE'
edge2 str

Edge type for ch2 ('RISE' or 'FALL')

'RISE'

Returns:

Type Description
float

Delay in seconds

Example

delay = scope.measure_delay(1, 2, 'RISE', 'RISE')

set_cursor_mode

set_cursor_mode(mode: str) -> None

Set cursor measurement mode.

Reference: pdf_chapters/3.8.1_CURSor_MODE.pdf

Parameters:

Name Type Description Default
mode str

Cursor mode - 'OFF', 'MANUAL', 'TRACK', or 'XY'

required

Raises:

Type Description
ValueError

If mode is invalid

VisaIOError

If communication fails

Example

scope.set_cursor_mode('MANUAL') scope.set_cursor_mode('OFF')

set_manual_cursor_type

set_manual_cursor_type(cursor_type: str) -> None

Set cursor type in manual mode.

Reference: pdf_chapters/3.8.3.1_CURSor_MANual_TYPE.pdf

Parameters:

Name Type Description Default
cursor_type str

'TIME' for X cursor (horizontal) or 'AMPLITUDE' for Y cursor (vertical)

required

Raises:

Type Description
ValueError

If cursor type is invalid

VisaIOError

If communication fails

Example

scope.set_manual_cursor_type('TIME') # X cursor for time measurements scope.set_manual_cursor_type('AMPLITUDE') # Y cursor for voltage measurements

set_manual_cursor_source

set_manual_cursor_source(source: str) -> None

Set channel source for manual cursor measurements.

Reference: pdf_chapters/3.8.3.2_CURSor_MANual_SOURce.pdf

Parameters:

Name Type Description Default
source str

Channel source - 'CHAN1', 'CHAN2', 'CHAN3', 'CHAN4', 'MATH1', 'MATH2', 'MATH3', 'MATH4', or 'NONE'

required

Raises:

Type Description
ValueError

If source is invalid

VisaIOError

If communication fails

Example

scope.set_manual_cursor_source('CHAN1') scope.set_manual_cursor_source('NONE') # Disable manual cursors

set_manual_cursor_positions

set_manual_cursor_positions(ax: float = None, ay: float = None, bx: float = None, by: float = None) -> None

Set manual cursor positions (horizontal and/or vertical).

Reference: pdf_chapters/3.8.3.3-3.8.3.6_CURSor_MANual_C*.pdf

Parameters:

Name Type Description Default
ax float

Cursor A X position in seconds (None = don't change)

None
ay float

Cursor A Y position in volts (None = don't change)

None
bx float

Cursor B X position in seconds (None = don't change)

None
by float

Cursor B Y position in volts (None = don't change)

None

Raises:

Type Description
VisaIOError

If communication fails

Example

Set both cursors for time measurement (10us and 20us)

scope.set_manual_cursor_positions(ax=10e-6, bx=20e-6)

Set both cursors for voltage measurement (1V and 2V)

scope.set_manual_cursor_positions(ay=1.0, by=2.0)

Set all four positions

scope.set_manual_cursor_positions(ax=10e-6, ay=1.0, bx=20e-6, by=2.0)

get_manual_cursor_values

get_manual_cursor_values() -> dict

Get all manual cursor measurement values.

Reference: pdf_chapters/3.8.3.7-3.8.3.13_CURSor_MANual_Value.pdf

Returns:

Type Description
dict

Dictionary with cursor measurements:

dict

{ 'ax': Cursor A X value (seconds), 'ay': Cursor A Y value (volts), 'bx': Cursor B X value (seconds), 'by': Cursor B Y value (volts), 'delta_x': Horizontal spacing ΔX (seconds), 'delta_y': Vertical spacing ΔY (volts), 'inv_delta_x': Reciprocal 1/ΔX (Hz)

dict

}

Raises:

Type Description
VisaIOError

If communication fails

Example

values = scope.get_manual_cursor_values() print(f"Time difference: {values['delta_x']*1e6:.2f} us") print(f"Voltage difference: {values['delta_y']:.3f} V") print(f"Frequency (1/ΔX): {values['inv_delta_x']:.2f} Hz")

set_track_cursor_sources

set_track_cursor_sources(source1: str, source2: str) -> None

Set channel sources for track cursor measurements.

Reference: pdf_chapters/3.8.4.1-3.8.4.2_CURSor_TRACk_SOURce*.pdf

Parameters:

Name Type Description Default
source1 str

Source for Cursor A - 'CHAN1', 'CHAN2', 'CHAN3', 'CHAN4', 'MATH1', 'MATH2', 'MATH3', 'MATH4', or 'NONE'

required
source2 str

Source for Cursor B (same options as source1)

required

Raises:

Type Description
ValueError

If source is invalid

VisaIOError

If communication fails

Example

Compare two channels

scope.set_track_cursor_sources('CHAN1', 'CHAN2')

Compare channel and math waveform

scope.set_track_cursor_sources('CHAN1', 'MATH1')

set_track_cursor_positions

set_track_cursor_positions(ax: float, bx: float) -> None

Set track cursor horizontal positions.

Reference: pdf_chapters/3.8.4.3-3.8.4.4_CURSor_TRACk_C*X.pdf

Parameters:

Name Type Description Default
ax float

Cursor A X position in seconds

required
bx float

Cursor B X position in seconds

required

Raises:

Type Description
VisaIOError

If communication fails

Example

Position cursors at 10us and 20us

scope.set_track_cursor_positions(ax=10e-6, bx=20e-6)

set_track_cursor_mode

set_track_cursor_mode(mode: str) -> None

Set axis for track cursor measurement.

Reference: pdf_chapters/3.8.4.14_CURSor_TRACk_MODE.pdf

Parameters:

Name Type Description Default
mode str

'X' for X-axis or 'Y' for Y-axis

required

Raises:

Type Description
ValueError

If mode is invalid

VisaIOError

If communication fails

Example

scope.set_track_cursor_mode('X') # Track along X-axis scope.set_track_cursor_mode('Y') # Track along Y-axis

get_track_cursor_values

get_track_cursor_values() -> dict

Get all track cursor measurement values.

Reference: pdf_chapters/3.8.4.7-3.8.4.13_CURSor_TRACk_Value.pdf

Returns:

Type Description
dict

Dictionary with cursor measurements:

dict

{ 'ax': Cursor A X value (seconds), 'ay': Cursor A Y value (volts), 'bx': Cursor B X value (seconds), 'by': Cursor B Y value (volts), 'delta_x': Horizontal spacing ΔX (seconds), 'delta_y': Vertical spacing ΔY (volts), 'inv_delta_x': Reciprocal 1/ΔX (Hz)

dict

}

Raises:

Type Description
VisaIOError

If communication fails

Example

values = scope.get_track_cursor_values() print(f"Cursor A: X={values['ax']1e6:.2f}us, Y={values['ay']:.3f}V") print(f"Cursor B: X={values['bx']1e6:.2f}us, Y={values['by']:.3f}V") print(f"ΔX={values['delta_x']*1e6:.2f}us, ΔY={values['delta_y']:.3f}V")

set_xy_cursor_positions

set_xy_cursor_positions(ax: float, ay: float, bx: float, by: float) -> None

Set XY cursor positions (only available when timebase mode is XY).

Reference: pdf_chapters/3.8.5.1-3.8.5.4_CURSor_XY_A*.pdf

Parameters:

Name Type Description Default
ax float

Cursor A X position in volts

required
ay float

Cursor A Y position in volts

required
bx float

Cursor B X position in volts

required
by float

Cursor B Y position in volts

required

Raises:

Type Description
VisaIOError

If communication fails

Note

XY mode is only available when horizontal timebase mode is set to XY.

Example

Position cursors in XY mode

scope.set_timebase_mode('XY') scope.set_cursor_mode('XY') scope.set_xy_cursor_positions(ax=0.5, ay=1.0, bx=1.5, by=2.0)

get_xy_cursor_values

get_xy_cursor_values() -> dict

Get all XY cursor measurement values.

Reference: pdf_chapters/3.8.5.5-3.8.5.10_CURSor_XY_Value.pdf

Returns:

Type Description
dict

Dictionary with cursor measurements:

dict

{ 'ax': Cursor A X value (volts), 'ay': Cursor A Y value (volts), 'bx': Cursor B X value (volts), 'by': Cursor B Y value (volts), 'delta_x': Horizontal spacing ΔX (volts), 'delta_y': Vertical spacing ΔY (volts)

dict

}

Raises:

Type Description
VisaIOError

If communication fails

Example

values = scope.get_xy_cursor_values() print(f"Cursor A: ({values['ax']:.3f}V, {values['ay']:.3f}V)") print(f"Cursor B: ({values['bx']:.3f}V, {values['by']:.3f}V)") print(f"Δ: ({values['delta_x']:.3f}V, {values['delta_y']:.3f}V)")

enable_math_channel

enable_math_channel(math_ch: int, enable: bool = True) -> None

Enable or disable a math channel.

Reference: pdf_chapters/3.16.1_MATH_n__DISPlay.pdf

Parameters:

Name Type Description Default
math_ch int

Math channel number (1-4)

required
enable bool

True to enable, False to disable

True

Raises:

Type Description
ValueError

If math_ch is invalid

VisaIOError

If communication fails

Example

scope.enable_math_channel(1, True) # Enable MATH1 scope.enable_math_channel(1, False) # Disable MATH1

set_math_scale

set_math_scale(math_ch: int, scale: float, offset: float = None) -> None

Set vertical scale and offset for math channel.

Reference: pdf_chapters/3.16.7_MATH_n__SCALe.pdf Reference: pdf_chapters/3.16.8_MATH_n__OFFSet.pdf

Parameters:

Name Type Description Default
math_ch int

Math channel number (1-4)

required
scale float

Vertical scale (V/div)

required
offset float

Vertical offset in volts (optional)

None

Raises:

Type Description
ValueError

If math_ch is invalid

VisaIOError

If communication fails

Example

scope.set_math_scale(1, 1.0) # 1V/div scope.set_math_scale(1, 0.5, 0.0) # 0.5V/div, 0V offset

configure_math_operation

configure_math_operation(math_ch: int, operation: str, source1: str, source2: str = None) -> None

Configure math channel for arithmetic operation.

Reference: pdf_chapters/3.16.2_MATH_n__OPERator.pdf Reference: pdf_chapters/3.16.3_MATH_n__SOURce1.pdf Reference: pdf_chapters/3.16.4_MATH_n__SOURce2.pdf

Parameters:

Name Type Description Default
math_ch int

Math channel number (1-4)

required
operation str

Operation type: 'ADD' (A+B), 'SUBTRACT' (A-B), 'MULTIPLY' (A×B), 'DIVISION' (A÷B)

required
source1 str

Source A - 'CHAN1', 'CHAN2', 'CHAN3', 'CHAN4'

required
source2 str

Source B (required for arithmetic operations)

None

Raises:

Type Description
ValueError

If parameters are invalid

VisaIOError

If communication fails

Example

Add two channels: MATH1 = CH1 + CH2

scope.configure_math_operation(1, 'ADD', 'CHAN1', 'CHAN2') scope.enable_math_channel(1, True)

Subtract channels: MATH1 = CH1 - CH2

scope.configure_math_operation(1, 'SUBTRACT', 'CHAN1', 'CHAN2')

configure_math_function

configure_math_function(math_ch: int, function: str, source: str) -> None

Configure math channel for function operation.

Reference: pdf_chapters/3.16.2_MATH_n__OPERator.pdf Reference: pdf_chapters/3.16.3_MATH_n__SOURce1.pdf

Parameters:

Name Type Description Default
math_ch int

Math channel number (1-4)

required
function str

Function type: 'INTG' (integrate), 'DIFF' (differentiate), 'SQRT' (square root), 'LG' (log base 10), 'LN' (natural log), 'EXP', 'ABS' (absolute value)

required
source str

Source channel - 'CHAN1', 'CHAN2', 'CHAN3', 'CHAN4'

required

Raises:

Type Description
ValueError

If parameters are invalid

VisaIOError

If communication fails

Example

Integrate CH1: MATH1 = ∫(CH1)

scope.configure_math_function(1, 'INTG', 'CHAN1') scope.enable_math_channel(1, True)

Differentiate CH1: MATH1 = d/dt(CH1)

scope.configure_math_function(1, 'DIFF', 'CHAN1')

Square root: MATH1 = √(CH1)

scope.configure_math_function(1, 'SQRT', 'CHAN1')

configure_fft

configure_fft(math_ch: int, source: str, window: str = 'RECT') -> None

Configure math channel for FFT (Fast Fourier Transform) analysis.

Reference: pdf_chapters/3.16.2_MATH_n__OPERator.pdf Reference: pdf_chapters/3.16.14_MATH_n__FFT_SOURce.pdf Reference: pdf_chapters/3.16.15_MATH_n__FFT_WINDow.pdf

Parameters:

Name Type Description Default
math_ch int

Math channel number (1-4)

required
source str

Source channel - 'CHAN1', 'CHAN2', 'CHAN3', 'CHAN4'

required
window str

FFT window function: 'RECT' (rectangular), 'BLACK' (Blackman), 'HANN' (Hanning), 'HAMM' (Hamming), 'FLAT' (Flattop), 'TRI' (Triangle) Default: 'RECT'

'RECT'

Raises:

Type Description
ValueError

If parameters are invalid

VisaIOError

If communication fails

Note

Different window functions trade off frequency resolution vs spectral leakage. RECT has best frequency resolution but most leakage. BLACKMAN has least leakage but poorer resolution.

Example

FFT of CH1 with Hanning window

scope.configure_fft(1, 'CHAN1', 'HANN') scope.enable_math_channel(1, True)

FFT with default rectangular window

scope.configure_fft(1, 'CHAN1')

configure_digital_filter

configure_digital_filter(math_ch: int, filter_type: str, source: str, cutoff_freq1: float, cutoff_freq2: float = None) -> None

Configure math channel for digital filtering.

Reference: pdf_chapters/3.16.2_MATH_n__OPERator.pdf Reference: pdf_chapters/3.16.29_MATH_n__FILTer_TYPE.pdf Reference: pdf_chapters/3.16.30_MATH_n__FILTer_W1.pdf Reference: pdf_chapters/3.16.31_MATH_n__FILTer_W2.pdf

Parameters:

Name Type Description Default
math_ch int

Math channel number (1-4)

required
filter_type str

Filter type: 'LPASS' (low-pass): Pass f < cutoff_freq1 'HPASS' (high-pass): Pass f > cutoff_freq1 'BPASS' (band-pass): Pass cutoff_freq1 < f < cutoff_freq2 'BSTOP' (band-stop): Stop cutoff_freq1 < f < cutoff_freq2

required
source str

Source channel - 'CHAN1', 'CHAN2', 'CHAN3', 'CHAN4'

required
cutoff_freq1 float

Cutoff frequency in Hz (or lower cutoff for band filters)

required
cutoff_freq2 float

Upper cutoff frequency in Hz (required for BPASS/BSTOP)

None

Raises:

Type Description
ValueError

If parameters are invalid

VisaIOError

If communication fails

Note

For band-pass and band-stop filters, cutoff_freq1 must be less than cutoff_freq2.

Example

Low-pass filter at 1kHz

scope.configure_digital_filter(1, 'LPASS', 'CHAN1', 1000) scope.enable_math_channel(1, True)

High-pass filter at 100Hz

scope.configure_digital_filter(1, 'HPASS', 'CHAN1', 100)

Band-pass filter 100Hz - 1kHz

scope.configure_digital_filter(1, 'BPASS', 'CHAN1', 100, 1000)

Band-stop (notch) filter 50Hz - 60Hz

scope.configure_digital_filter(1, 'BSTOP', 'CHAN1', 50, 60)

set_acquisition_type

set_acquisition_type(acq_type: str) -> None

Set the acquisition type.

Reference: pdf_chapters/3.3.3_ACQuire_TYPE.pdf

Parameters:

Name Type Description Default
acq_type str

Acquisition type: 'NORMAL' - Normal sampling mode (default) 'PEAK' - Peak detect mode (captures min/max values) 'AVERAGE' - Average mode (reduces noise, use set_average_count()) 'ULTRA' - Ultra acquisition mode (high refresh rate segmented memory)

required

Raises:

Type Description
ValueError

If acquisition type is invalid

VisaIOError

If communication fails

Note
  • NORMAL: Standard sampling, best for general purpose measurements
  • PEAK: Useful for detecting glitches and narrow pulses
  • AVERAGE: Reduces random noise, requires set_average_count()
  • ULTRA: Enables segmented memory for high waveform capture rate
Example

Set to average mode

scope.set_acquisition_type('AVERAGE') scope.set_average_count(64)

Set to peak detect mode

scope.set_acquisition_type('PEAK')

set_average_count

set_average_count(count: int) -> None

Set the number of averages for AVERAGE acquisition mode.

Reference: pdf_chapters/3.3.1_ACQuire_AVERages.pdf

Parameters:

Name Type Description Default
count int

Number of averages (must be power of 2: 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536) Range: 2 to 65536 (2^1 to 2^16)

required

Raises:

Type Description
ValueError

If count is not a valid power of 2 in range

VisaIOError

If communication fails

Note
  • Higher average counts reduce noise but slow down waveform update rate
  • Only applies when acquisition type is set to AVERAGE
  • Count must be exact power of 2 (2^n where n = 1 to 16)
Example

Set to 64 averages

scope.set_acquisition_type('AVERAGE') scope.set_average_count(64)

set_memory_depth

set_memory_depth(depth: str) -> None

Set the memory depth (number of waveform points stored).

Reference: pdf_chapters/3.3.2_ACQuire_MDEPth.pdf

Parameters:

Name Type Description Default
depth str

Memory depth setting: 'AUTO' - Automatic memory depth (recommended) Or specific values: '1k', '10k', '100k', '1M', '5M', '10M', '25M', '50M'

required

Raises:

Type Description
ValueError

If memory depth value is invalid

VisaIOError

If communication fails

Note
  • Available depths depend on number of enabled channels
  • More memory depth = higher resolution but slower waveform update
  • AUTO mode automatically selects optimal depth
  • 1 channel enabled: up to 50M points
  • 2 channels enabled: up to 25M points each
  • 3-4 channels enabled: up to 10M points each
Example

Set to automatic

scope.set_memory_depth('AUTO')

Set to 10M points

scope.set_memory_depth('10M')

get_memory_depth

get_memory_depth() -> str

Query the current memory depth setting.

Reference: pdf_chapters/3.3.2_ACQuire_MDEPth.pdf

Returns:

Name Type Description
str str

Current memory depth ('AUTO', '1K', '10K', '100K', '1M', '5M', '10M', '25M', or '50M')

Raises:

Type Description
VisaIOError

If communication fails

Example

depth = scope.get_memory_depth() print(f"Current memory depth: {depth}")

get_sample_rate

get_sample_rate() -> float

Query the current sample rate.

Reference: pdf_chapters/3.3.4_ACQuire_SRATe_.pdf

Returns:

Name Type Description
float float

Current sample rate in Sa/s (samples per second)

Raises:

Type Description
VisaIOError

If communication fails

Note
  • Sample rate depends on horizontal scale and memory depth
  • Returns actual sampling frequency in scientific notation
  • Higher sample rates provide better time resolution
Example

rate = scope.get_sample_rate() print(f"Sample rate: {rate/1e9:.2f} GSa/s")

clear_display

clear_display() -> None

Clear all waveforms on the screen.

Reference: pdf_chapters/3.9.1_DISPlay_CLEar.pdf

Raises:

Type Description
VisaIOError

If communication fails

Note
  • If oscilloscope is in RUN state, new waveforms continue after clearing
  • Same as pressing the CLEAR button on the front panel
  • Can also use the :CLEar command directly
Example

scope.clear_display()

set_display_type

set_display_type(display_type: str) -> None

Set the display type of waveforms on the screen.

Reference: pdf_chapters/3.9.2_DISPlay_TYPE.pdf

Parameters:

Name Type Description Default
display_type str

Display type - 'VECTORS' (sample points connected by lines)

required

Raises:

Type Description
ValueError

If display type is invalid

VisaIOError

If communication fails

Note
  • VECTORS mode provides the most vivid waveform display
  • Best for viewing steep edges (e.g., square waves)
  • Currently only VECTORS mode is supported by DHO804
Example

scope.set_display_type('VECTORS')

set_grid_type

set_grid_type(grid: str) -> None

Set the display type of the screen grid.

Reference: pdf_chapters/3.9.5_DISPlay_GRID.pdf

Parameters:

Name Type Description Default
grid str

Grid type: 'FULL' - Background grid and coordinates on (default) 'HALF' - Background grid off, coordinates on 'NONE' - Background grid and coordinates off

required

Raises:

Type Description
ValueError

If grid type is invalid

VisaIOError

If communication fails

Note
  • FULL: Shows complete grid with divisions and coordinates
  • HALF: Shows only coordinate axes without grid lines
  • NONE: Clean display with no reference lines
Example

Full grid

scope.set_grid_type('FULL')

Coordinates only, no grid

scope.set_grid_type('HALF')

Clean display

scope.set_grid_type('NONE')

set_persistence

set_persistence(time: str) -> None

Set the waveform persistence time.

Reference: pdf_chapters/3.9.3_DISPlay_GRADing_TIME.pdf

Parameters:

Name Type Description Default
time str

Persistence time: 'MIN' - Minimum persistence (high refresh rate) '0.1', '0.2', '0.5', '1', '2', '5', '10' - Time in seconds 'INFINITE' - Infinite persistence (no clearing)

required

Raises:

Type Description
ValueError

If time value is invalid

VisaIOError

If communication fails

Note
  • MIN: Best for viewing rapidly changing waveforms
  • Specific values (0.1-10s): Good for observing slow glitches
  • INFINITE: Accumulates all waveforms, useful for jitter/noise analysis and capturing rare events
Example

High refresh rate

scope.set_persistence('MIN')

100ms persistence to catch glitches

scope.set_persistence('0.1')

Infinite persistence for jitter analysis

scope.set_persistence('INFINITE')

get_screenshot

get_screenshot() -> bytes

Capture the current screen image as bitmap data.

Reference: pdf_chapters/3.9.7_DISPlay_DATA_.pdf

Returns:

Name Type Description
bytes bytes

Bitmap data stream of the currently displayed image

Raises:

Type Description
VisaIOError

If communication fails

Note
  • Returns raw bitmap data of the screen
  • Data format is typically BMP or PNG depending on oscilloscope
  • Can be saved directly to a file with .bmp or .png extension
  • Large data transfer - may take several seconds
Example

Capture and save screenshot

screenshot_data = scope.get_screenshot() with open('screenshot.bmp', 'wb') as f: f.write(screenshot_data)

set_waveform_brightness

set_waveform_brightness(brightness: int) -> None

Set the brightness of waveforms on the screen.

Reference: pdf_chapters/3.9.4_DISPlay_WBRightness.pdf

Parameters:

Name Type Description Default
brightness int

Brightness level in percentage (1-100)

required

Raises:

Type Description
ValueError

If brightness is out of range

VisaIOError

If communication fails

Note
  • Higher values make waveforms brighter and more visible
  • Lower values reduce waveform intensity
  • Default is 50%
  • Range: 1% to 100%
Example

Default brightness

scope.set_waveform_brightness(50)

Very bright for photos

scope.set_waveform_brightness(100)

Dim for low-light viewing

scope.set_waveform_brightness(20)

set_grid_brightness

set_grid_brightness(brightness: int) -> None

Set the brightness of the screen grid.

Reference: pdf_chapters/3.9.6_DISPlay_GBRightness.pdf

Parameters:

Name Type Description Default
brightness int

Grid brightness level in percentage (0-100)

required

Raises:

Type Description
ValueError

If brightness is out of range

VisaIOError

If communication fails

Note
  • Higher values make grid lines brighter
  • 0% makes grid invisible (same as NONE grid type)
  • Default is 50%
  • Range: 0% to 100%
Example

Default brightness

scope.set_grid_brightness(50)

Bright grid

scope.set_grid_brightness(80)

Subtle grid

scope.set_grid_brightness(20)

Invisible grid

scope.set_grid_brightness(0)

save_screenshot_to_scope

save_screenshot_to_scope(path: str) -> None

Save screenshot to oscilloscope's internal or external storage.

Reference: pdf_chapters/3.21.6_SAVE_IMAGe.pdf

Parameters:

Name Type Description Default
path str

File path on oscilloscope storage - Internal storage: 'C:/filename.png' - External USB: 'D:/filename.png' or 'E:/filename.png' - Supported formats: .bmp, .png, .jpg - Filename max 16 characters (non-Chinese)

required

Raises:

Type Description
ValueError

If path format is invalid

VisaIOError

If communication fails or path is invalid

Note
  • Saves to oscilloscope's storage, not PC
  • Use get_screenshot() to transfer image data to PC
  • Set :SAVE:OVERlap ON to overwrite existing files
  • Image format can be configured with :SAVE:IMAGe:FORMat
Example

Save to internal storage

scope.save_screenshot_to_scope('C:/screenshot1.png')

Save to USB drive

scope.save_screenshot_to_scope('D:/test.jpg')

save_setup

save_setup(path: str) -> None

Save current oscilloscope setup/configuration to file.

Reference: pdf_chapters/3.21.7_SAVE_SETup.pdf

Parameters:

Name Type Description Default
path str

File path on oscilloscope storage - Internal storage: 'C:/filename.stp' - External USB: 'D:/filename.stp' or 'E:/filename.stp' - File format must be: .stp - Filename max 16 characters (non-Chinese)

required

Raises:

Type Description
ValueError

If path format is invalid

VisaIOError

If communication fails or path is invalid

Note
  • Saves all current settings (channels, timebase, trigger, etc.)
  • Can be recalled with load_setup()
  • Set :SAVE:OVERlap ON to overwrite existing files
Example

Save current configuration

scope.save_setup('C:/my_config.stp')

Save to USB drive

scope.save_setup('D:/test_setup.stp')

load_setup

load_setup(path: str) -> None

Load oscilloscope setup/configuration from file.

Reference: pdf_chapters/3.21.20_LOAD_SETup.pdf

Parameters:

Name Type Description Default
path str

File path on oscilloscope storage - Internal storage: 'C:/filename.stp' - External USB: 'D:/filename.stp' or 'E:/filename.stp' - File format must be: .stp

required

Raises:

Type Description
ValueError

If path format is invalid

VisaIOError

If communication fails, file not found, or invalid file

Note
  • Loads all settings from previously saved setup file
  • Overwrites current oscilloscope configuration
  • File must have been saved with save_setup()
Example

Load configuration from internal storage

scope.load_setup('C:/my_config.stp')

Load from USB drive

scope.load_setup('D:/test_setup.stp')

save_waveform_to_scope

save_waveform_to_scope(path: str) -> None

Save screen waveform data to oscilloscope storage.

Reference: pdf_chapters/3.21.8_SAVE_WAVeform.pdf

Parameters:

Name Type Description Default
path str

File path on oscilloscope storage - Internal storage: 'C:/filename.csv' or 'C:/filename.bin' - External USB: 'D:/filename.csv' or 'D:/filename.bin' - Supported formats: .csv (text), .bin (binary) - Filename max 16 characters (non-Chinese)

required

Raises:

Type Description
ValueError

If path format is invalid

VisaIOError

If communication fails or path is invalid

Note
  • Saves waveform data from currently displayed channels
  • CSV format: Human-readable, larger file size
  • BIN format: Binary, smaller file size
  • Set :SAVE:OVERlap ON to overwrite existing files
Example

Save as CSV for analysis in Excel

scope.save_waveform_to_scope('C:/data.csv')

Save as binary for compact storage

scope.save_waveform_to_scope('D:/waveform.bin')

get_identity

get_identity() -> str

Query instrument identification string.

Reference: pdf_chapters/3.12.1_IDN_.pdf

Returns:

Name Type Description
str str

Identification string in format: RIGOL TECHNOLOGIES,,,

Raises:

Type Description
VisaIOError

If communication fails

Note
  • Standard IEEE 488.2 command
  • Returns manufacturer, model, serial number, and firmware version
  • Useful for instrument identification and version checking
Example

idn = scope.get_identity() print(idn)

Output: RIGOL TECHNOLOGIES,DHO804,DHO8A264M00015,00.01.02.00.01

reset

reset() -> None

Reset oscilloscope to factory default settings.

Reference: pdf_chapters/3.12.2_RST.pdf

Raises:

Type Description
VisaIOError

If communication fails

Note
  • Standard IEEE 488.2 command
  • Resets all settings to factory defaults
  • Clears all measurements and waveform data
  • Does NOT clear error queue (use clear_status() for that)
  • Oscilloscope will take a few seconds to complete reset
WARNING

This command will erase all current settings! Save your configuration first if needed.

Example

Save current config before reset

scope.save_setup('C:/backup.stp')

Reset to defaults

scope.reset() time.sleep(3) # Wait for reset to complete

clear_status

clear_status() -> None

Clear status byte and error queue.

Reference: pdf_chapters/3.12.3_CLS.pdf

Raises:

Type Description
VisaIOError

If communication fails

Note
  • Standard IEEE 488.2 command
  • Clears the status byte register
  • Clears the standard event status register
  • Clears the error queue
  • Does NOT reset instrument settings (use reset() for that)
Example

Clear any previous errors

scope.clear_status()

Perform operations

scope.configure_trigger(1, 1.0, 'RISE')

Check for errors

status = scope.get_status_byte()

operation_complete

operation_complete() -> None

Set Operation Complete bit when all pending operations finish.

Reference: pdf_chapters/3.12.6_OPC.pdf

Raises:

Type Description
VisaIOError

If communication fails

Note
  • Standard IEEE 488.2 command
  • Sets bit 0 in Standard Event Status Register when complete
  • Use for synchronization in command sequences
  • Query form (*OPC?) waits and returns 1 when complete
Example

Start a long operation

scope.set_memory_depth('50M') scope.operation_complete()

Or use query form to wait

result = scope.instrument.query('*OPC?')

Returns '1' when operation completes

get_status_byte

get_status_byte() -> int

Query the status byte register.

Reference: pdf_chapters/3.12.10_STB_.pdf

Returns:

Name Type Description
int int

Status byte value (0-255) Bit 4 (16): Message Available (MAV) Bit 5 (32): Event Status Bit (ESB) Bit 6 (64): Master Summary Status (MSS) Bit 7 (128): Operation Status Register

Raises:

Type Description
VisaIOError

If communication fails

Note
  • Standard IEEE 488.2 command
  • Returns status byte register value
  • Bits indicate various status conditions
  • Check specific bits to determine status
Example

status = scope.get_status_byte()

Check Message Available bit

if status & 16: print("Data available in output buffer")

Check Event Status bit

if status & 32: print("Event occurred")

self_test

self_test() -> bool

Perform oscilloscope self-test.

Reference: pdf_chapters/3.12.12_TST_.pdf

Returns:

Name Type Description
bool bool

True if self-test passes, False if it fails

Raises:

Type Description
VisaIOError

If communication fails

Note
  • Standard IEEE 488.2 command
  • Performs internal self-test
  • Returns 0 if passes, 1 if fails
  • If fails, check error queue with :SYSTem:ERRor[:NEXT]?
  • Self-test may take several seconds
Example

print("Running self-test...") if scope.self_test(): print("Self-test PASSED") else: print("Self-test FAILED - check error queue") # Query error details if needed

autoset

autoset() -> None

Execute autoset to automatically optimize display settings.

Reference: pdf_chapters/3.2.1_AUToset.pdf

Raises:

Type Description
VisaIOError

If communication fails

Note
  • Automatically adjusts vertical scale, horizontal timebase, and trigger mode
  • Optimizes waveform display based on input signal
  • Same as pressing AUTO button on front panel
  • Only works if AUTO function is enabled (see set_autoset_enable())
  • Disables pass/fail test and waveform recording if they are active
  • May take a few seconds to complete
Example

Enable autoset function

scope.set_autoset_enable(True)

Execute autoset

scope.autoset() time.sleep(2) # Wait for autoset to complete

autoset_peak

autoset_peak() -> None

Execute autoset with peak detection optimization.

Reference: pdf_chapters/3.2.2_AUToset_PEAK.pdf

Raises:

Type Description
VisaIOError

If communication fails

Note
  • Similar to autoset() but optimized for peak detection
  • Useful for detecting glitches and transient signals
  • Automatically adjusts settings for optimal peak visibility
  • May take a few seconds to complete
Example

Execute peak detect autoset

scope.autoset_peak() time.sleep(2) # Wait for completion

set_autoset_enable

set_autoset_enable(enable: bool) -> None

Enable or disable the AUTO function.

Reference: pdf_chapters/3.2.7_AUToset_ENAble.pdf

Parameters:

Name Type Description Default
enable bool

True to enable AUTO function, False to disable

required

Raises:

Type Description
VisaIOError

If communication fails

Note
  • Enables/disables the AUTO button functionality
  • When disabled, autoset() command will have no effect
  • Same as :AUToset:LOCK command (inverted logic)
  • Default is enabled (True)
Example

Enable autoset function

scope.set_autoset_enable(True)

Disable autoset to prevent accidental triggering

scope.set_autoset_enable(False)

get_autoset_enable

get_autoset_enable() -> bool

Query whether the AUTO function is enabled.

Reference: pdf_chapters/3.2.7_AUToset_ENAble.pdf

Returns:

Name Type Description
bool bool

True if AUTO function is enabled, False if disabled

Raises:

Type Description
VisaIOError

If communication fails

Example

if scope.get_autoset_enable(): print("AUTO function is enabled") scope.autoset() else: print("AUTO function is disabled")

set_beeper_enable

set_beeper_enable(enable: bool) -> None

Enable or disable the oscilloscope beeper.

Reference: pdf_chapters/3.24.2_SYSTem_BEEPer.pdf

Parameters:

Name Type Description Default
enable bool

True to enable beeper, False to disable

required

Raises:

Type Description
VisaIOError

If communication fails

Example

Enable beeper

scope.set_beeper_enable(True)

Disable beeper for quiet operation

scope.set_beeper_enable(False)

get_beeper_enable

get_beeper_enable() -> bool

Query whether the beeper is enabled.

Reference: pdf_chapters/3.24.2_SYSTem_BEEPer.pdf

Returns:

Name Type Description
bool bool

True if beeper is enabled, False if disabled

Raises:

Type Description
VisaIOError

If communication fails

Example

if scope.get_beeper_enable(): print("Beeper is enabled") else: print("Beeper is disabled")

get_next_error

get_next_error() -> dict

Query and clear the next error from the error queue.

Reference: pdf_chapters/3.24.3_SYSTem_ERRor[NEXT].pdf

Returns:

Name Type Description
dict dict

Dictionary with 'code' (int) and 'message' (str) Returns {'code': 0, 'message': 'No error'} if queue is empty

Raises:

Type Description
VisaIOError

If communication fails

Example

error = scope.get_next_error() if error['code'] != 0: print(f"Error {error['code']}: {error['message']}") else: print("No errors in queue")

set_front_panel_lock

set_front_panel_lock(locked: bool) -> None

Lock or unlock the front panel keys and touchscreen.

Reference: pdf_chapters/3.24.9_SYSTem_LOCKed.pdf

Parameters:

Name Type Description Default
locked bool

True to lock front panel, False to unlock

required

Raises:

Type Description
VisaIOError

If communication fails

Example

Lock front panel during automated testing

scope.set_front_panel_lock(True)

Perform automated measurements

...

Unlock when done

scope.set_front_panel_lock(False)

get_front_panel_lock

get_front_panel_lock() -> bool

Query whether the front panel is locked.

Reference: pdf_chapters/3.24.9_SYSTem_LOCKed.pdf

Returns:

Name Type Description
bool bool

True if front panel is locked, False if unlocked

Raises:

Type Description
VisaIOError

If communication fails

Example

if scope.get_front_panel_lock(): print("Front panel is locked") else: print("Front panel is unlocked")

get_scpi_version

get_scpi_version() -> str

Query the SCPI version number used by the oscilloscope.

Reference: pdf_chapters/3.24.13_SYSTem_VERSion_.pdf

Returns:

Name Type Description
str str

SCPI version number (e.g., "3.0")

Raises:

Type Description
VisaIOError

If communication fails

Example

version = scope.get_scpi_version() print(f"SCPI version: {version}")

get_channel_count

get_channel_count() -> int

Query the number of analog channels on the oscilloscope.

Reference: pdf_chapters/3.24.6_SYSTem_RAMount_.pdf

Returns:

Name Type Description
int int

Number of analog channels (typically 2 or 4)

Raises:

Type Description
VisaIOError

If communication fails

Example

channels = scope.get_channel_count() print(f"This oscilloscope has {channels} analog channels")

set_recording_enable

set_recording_enable(enable: bool) -> None

Enable or disable the waveform recording function.

Reference: pdf_chapters/3.19.1_RECord_WRECord_ENABle.pdf

Parameters:

Name Type Description Default
enable bool

True to enable recording, False to disable

required

Raises:

Type Description
VisaIOError

If communication fails

Example

Enable recording function

scope.set_recording_enable(True)

Disable recording function

scope.set_recording_enable(False)

get_recording_enable

get_recording_enable() -> bool

Query whether the waveform recording function is enabled.

Reference: pdf_chapters/3.19.1_RECord_WRECord_ENABle.pdf

Returns:

Name Type Description
bool bool

True if recording is enabled, False if disabled

Raises:

Type Description
VisaIOError

If communication fails

Example

if scope.get_recording_enable(): print("Recording is enabled") else: print("Recording is disabled")

set_recording_frames

set_recording_frames(frames: int) -> None

Set the number of frames to record.

Reference: pdf_chapters/3.19.5_RECord_WRECord_FRAMes.pdf

Parameters:

Name Type Description Default
frames int

Number of frames to record (1 to max available)

required

Raises:

Type Description
ValueError

If frames is less than 1

VisaIOError

If communication fails

Example

Record 1000 frames

scope.set_recording_frames(1000)

Record 100 frames

scope.set_recording_frames(100)

get_recording_frames

get_recording_frames() -> int

Query the number of frames configured for recording.

Reference: pdf_chapters/3.19.5_RECord_WRECord_FRAMes.pdf

Returns:

Name Type Description
int int

Number of frames configured for recording

Raises:

Type Description
VisaIOError

If communication fails

Example

frames = scope.get_recording_frames() print(f"Will record {frames} frames")

get_max_recording_frames

get_max_recording_frames() -> int

Query the maximum number of frames that can be recorded.

Reference: pdf_chapters/3.19.8_RECord_WRECord_FMAX_.pdf

Returns:

Name Type Description
int int

Maximum number of frames available for recording

Raises:

Type Description
VisaIOError

If communication fails

Example

max_frames = scope.get_max_recording_frames() print(f"Can record up to {max_frames} frames")

start_recording

start_recording() -> None

Start waveform recording.

Reference: pdf_chapters/3.19.3_RECord_WRECord_OPERate.pdf

Raises:

Type Description
VisaIOError

If communication fails

Example

Enable recording and start

scope.set_recording_enable(True) scope.set_recording_frames(1000) scope.start_recording()

Wait for recording to complete

time.sleep(5) scope.stop_recording()

stop_recording

stop_recording() -> None

Stop waveform recording.

Reference: pdf_chapters/3.19.3_RECord_WRECord_OPERate.pdf

Raises:

Type Description
VisaIOError

If communication fails

Example

Stop ongoing recording

scope.stop_recording()

get_recording_status

get_recording_status() -> str

Query whether waveform recording is running or stopped.

Reference: pdf_chapters/3.19.3_RECord_WRECord_OPERate.pdf

Returns:

Name Type Description
str str

'RUN' if recording is active, 'STOP' if not

Raises:

Type Description
VisaIOError

If communication fails

Example

status = scope.get_recording_status() if status == 'RUN': print("Recording in progress") else: print("Recording stopped")

set_playback_current_frame

set_playback_current_frame(frame: int) -> None

Set the current frame for playback.

Reference: pdf_chapters/3.19.11_RECord_WREPlay_FCURrent.pdf

Parameters:

Name Type Description Default
frame int

Frame number to display (1 to number of recorded frames)

required

Raises:

Type Description
ValueError

If frame is less than 1

VisaIOError

If communication fails

Example

Jump to frame 500

scope.set_playback_current_frame(500)

get_playback_current_frame

get_playback_current_frame() -> int

Query the current frame in playback.

Reference: pdf_chapters/3.19.11_RECord_WREPlay_FCURrent.pdf

Returns:

Name Type Description
int int

Current frame number

Raises:

Type Description
VisaIOError

If communication fails

Example

frame = scope.get_playback_current_frame() print(f"Currently viewing frame {frame}")

start_playback

start_playback() -> None

Start automatic playback of recorded waveforms.

Reference: pdf_chapters/3.19.20_RECord_WREPlay_OPERate.pdf

Raises:

Type Description
VisaIOError

If communication fails

Example

Start automatic playback

scope.start_playback()

Playback will cycle through recorded frames

time.sleep(10) scope.stop_playback()

stop_playback

stop_playback() -> None

Stop automatic playback of recorded waveforms.

Reference: pdf_chapters/3.19.20_RECord_WREPlay_OPERate.pdf

Raises:

Type Description
VisaIOError

If communication fails

Example

Stop playback

scope.stop_playback()

get_playback_status

get_playback_status() -> str

Query whether automatic playback is running or stopped.

Reference: pdf_chapters/3.19.20_RECord_WREPlay_OPERate.pdf

Returns:

Name Type Description
str str

'RUN' if playback is active, 'STOP' if not

Raises:

Type Description
VisaIOError

If communication fails

Example

status = scope.get_playback_status() if status == 'RUN': print("Playback in progress") else: print("Playback stopped")

playback_next_frame

playback_next_frame() -> None

Manually step to the next frame in playback.

Reference: pdf_chapters/3.19.23_RECord_WREPlay_NEXT.pdf

Raises:

Type Description
VisaIOError

If communication fails

Example

Step through frames manually

for i in range(10): scope.playback_next_frame() time.sleep(0.5)

playback_previous_frame

playback_previous_frame() -> None

Manually step to the previous frame in playback.

Reference: pdf_chapters/3.19.22_RECord_WREPlay_BACK.pdf

Raises:

Type Description
VisaIOError

If communication fails

Example

Step backward through frames

for i in range(10): scope.playback_previous_frame() time.sleep(0.5)

set_mask_enable

set_mask_enable(enable: bool) -> None

Enable or disable the pass/fail mask testing function.

Reference: pdf_chapters/3.15.1_MASK_ENABle.pdf

Parameters:

Name Type Description Default
enable bool

True to enable mask testing, False to disable

required

Raises:

Type Description
VisaIOError

If communication fails

Example

Enable mask testing

scope.set_mask_enable(True)

Disable mask testing

scope.set_mask_enable(False)

get_mask_enable

get_mask_enable() -> bool

Query whether the pass/fail mask testing function is enabled.

Reference: pdf_chapters/3.15.1_MASK_ENABle.pdf

Returns:

Name Type Description
bool bool

True if mask testing is enabled, False if disabled

Raises:

Type Description
VisaIOError

If communication fails

Example

if scope.get_mask_enable(): print("Mask testing is enabled") else: print("Mask testing is disabled")

set_mask_source

set_mask_source(channel: int) -> None

Set the source channel for pass/fail mask testing.

Reference: pdf_chapters/3.15.2_MASK_SOURce.pdf

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required

Raises:

Type Description
ValueError

If channel is not 1-4

VisaIOError

If communication fails

Example

Test channel 1 against mask

scope.set_mask_source(1)

Test channel 2 against mask

scope.set_mask_source(2)

get_mask_source

get_mask_source() -> int

Query the source channel for pass/fail mask testing.

Reference: pdf_chapters/3.15.2_MASK_SOURce.pdf

Returns:

Name Type Description
int int

Channel number (1-4)

Raises:

Type Description
VisaIOError

If communication fails

Example

channel = scope.get_mask_source() print(f"Testing channel {channel}")

set_mask_tolerance_x

set_mask_tolerance_x(tolerance: float) -> None

Set the horizontal (time) tolerance for the mask.

Reference: pdf_chapters/3.15.4_MASK_X.pdf

Parameters:

Name Type Description Default
tolerance float

Horizontal tolerance in divisions (0.01 to 2.0)

required

Raises:

Type Description
ValueError

If tolerance is out of range

VisaIOError

If communication fails

Example

Set horizontal tolerance to 0.3 divisions

scope.set_mask_tolerance_x(0.3)

get_mask_tolerance_x

get_mask_tolerance_x() -> float

Query the horizontal (time) tolerance for the mask.

Reference: pdf_chapters/3.15.4_MASK_X.pdf

Returns:

Name Type Description
float float

Horizontal tolerance in divisions

Raises:

Type Description
VisaIOError

If communication fails

Example

tolerance = scope.get_mask_tolerance_x() print(f"Horizontal tolerance: {tolerance} div")

set_mask_tolerance_y

set_mask_tolerance_y(tolerance: float) -> None

Set the vertical (voltage) tolerance for the mask.

Reference: pdf_chapters/3.15.5_MASK_Y.pdf

Parameters:

Name Type Description Default
tolerance float

Vertical tolerance in divisions (0.04 to 2.0)

required

Raises:

Type Description
ValueError

If tolerance is out of range

VisaIOError

If communication fails

Example

Set vertical tolerance to 0.5 divisions

scope.set_mask_tolerance_y(0.5)

get_mask_tolerance_y

get_mask_tolerance_y() -> float

Query the vertical (voltage) tolerance for the mask.

Reference: pdf_chapters/3.15.5_MASK_Y.pdf

Returns:

Name Type Description
float float

Vertical tolerance in divisions

Raises:

Type Description
VisaIOError

If communication fails

Example

tolerance = scope.get_mask_tolerance_y() print(f"Vertical tolerance: {tolerance} div")

create_mask

create_mask() -> None

Create a pass/fail mask from the current waveform.

Reference: pdf_chapters/3.15.6_MASK_CREate.pdf

Raises:

Type Description
VisaIOError

If communication fails

Example

Setup ideal waveform

scope.enable_channel(1) scope.run() time.sleep(1)

Set tolerances

scope.set_mask_tolerance_x(0.3) scope.set_mask_tolerance_y(0.5)

Create mask from current waveform

scope.create_mask()

start_mask_test

start_mask_test() -> None

Start the pass/fail mask test.

Reference: pdf_chapters/3.15.3_MASK_OPERate.pdf

Raises:

Type Description
VisaIOError

If communication fails

Example

Enable and start mask testing

scope.set_mask_enable(True) scope.start_mask_test()

Wait for testing

time.sleep(10)

Check results

stats = scope.get_mask_statistics() print(f"Passed: {stats['passed']}, Failed: {stats['failed']}")

scope.stop_mask_test()

stop_mask_test

stop_mask_test() -> None

Stop the pass/fail mask test.

Reference: pdf_chapters/3.15.3_MASK_OPERate.pdf

Raises:

Type Description
VisaIOError

If communication fails

Example

Stop mask testing

scope.stop_mask_test()

get_mask_test_status

get_mask_test_status() -> str

Query whether the mask test is running or stopped.

Reference: pdf_chapters/3.15.3_MASK_OPERate.pdf

Returns:

Name Type Description
str str

'RUN' if testing is active, 'STOP' if not

Raises:

Type Description
VisaIOError

If communication fails

Example

status = scope.get_mask_test_status() if status == 'RUN': print("Mask test in progress") else: print("Mask test stopped")

reset_mask_statistics

reset_mask_statistics() -> None

Reset the pass/fail test statistics counters.

Reference: pdf_chapters/3.15.7_MASK_RESet.pdf

Raises:

Type Description
VisaIOError

If communication fails

Example

Reset counters before starting new test

scope.reset_mask_statistics() scope.start_mask_test()

get_mask_failed_count

get_mask_failed_count() -> int

Query the number of frames that failed the mask test.

Reference: pdf_chapters/3.15.8_MASK_FAILed_.pdf

Returns:

Name Type Description
int int

Number of failed frames

Raises:

Type Description
VisaIOError

If communication fails

Example

failed = scope.get_mask_failed_count() print(f"{failed} frames failed the test")

get_mask_passed_count

get_mask_passed_count() -> int

Query the number of frames that passed the mask test.

Reference: pdf_chapters/3.15.9_MASK_PASSed_.pdf

Returns:

Name Type Description
int int

Number of passed frames

Raises:

Type Description
VisaIOError

If communication fails

Example

passed = scope.get_mask_passed_count() print(f"{passed} frames passed the test")

get_mask_total_count

get_mask_total_count() -> int

Query the total number of frames tested.

Reference: pdf_chapters/3.15.10_MASK_TOTal_.pdf

Returns:

Name Type Description
int int

Total number of frames tested

Raises:

Type Description
VisaIOError

If communication fails

Example

total = scope.get_mask_total_count() print(f"{total} total frames tested")

get_mask_statistics

get_mask_statistics() -> dict

Query all pass/fail test statistics at once.

Returns:

Name Type Description
dict dict

Dictionary with 'passed', 'failed', 'total' counts

Raises:

Type Description
VisaIOError

If communication fails

Example

stats = scope.get_mask_statistics() print(f"Results: {stats['passed']} passed, {stats['failed']} failed") print(f"Pass rate: {stats['passed']/stats['total']*100:.1f}%")

get_counter_current

get_counter_current() -> float

Query the current measurement value of the frequency counter.

Returns:

Name Type Description
float float

Current counter measurement value in scientific notation

Raises:

Type Description
VisaIOError

If communication fails

Example

freq = scope.get_counter_current() print(f"Current measurement: {freq} Hz")

set_counter_enable

set_counter_enable(enable: bool) -> None

Enable or disable the frequency counter.

Parameters:

Name Type Description Default
enable bool

True to enable, False to disable

required

Raises:

Type Description
VisaIOError

If communication fails

Example

scope.set_counter_enable(True) # Enable counter

get_counter_enable

get_counter_enable() -> bool

Query the on/off status of the frequency counter.

Returns:

Name Type Description
bool bool

True if enabled, False if disabled

Raises:

Type Description
VisaIOError

If communication fails

Example

if scope.get_counter_enable(): print("Counter is enabled")

set_counter_source

set_counter_source(source: int) -> None

Set the source of the frequency counter.

Parameters:

Name Type Description Default
source int

Channel number (1-4) for analog channels

required

Raises:

Type Description
VisaIOError

If communication fails

ValueError

If source is invalid

Example

scope.set_counter_source(1) # Set to CH1

get_counter_source

get_counter_source() -> int

Query the source of the frequency counter.

Returns:

Name Type Description
int int

Channel number (1-4)

Raises:

Type Description
VisaIOError

If communication fails

Example

source = scope.get_counter_source() print(f"Counter source: CH{source}")

set_counter_mode

set_counter_mode(mode: str) -> None

Set the mode of the frequency counter.

Parameters:

Name Type Description Default
mode str

Counter mode ('FREQuency', 'PERiod', or 'TOTalize')

required

Raises:

Type Description
VisaIOError

If communication fails

ValueError

If mode is invalid

Example

scope.set_counter_mode('FREQuency') # Measure frequency scope.set_counter_mode('PERiod') # Measure period

get_counter_mode

get_counter_mode() -> str

Query the mode of the frequency counter.

Returns:

Name Type Description
str str

Counter mode ('FREQ', 'PER', or 'TOT')

Raises:

Type Description
VisaIOError

If communication fails

Example

mode = scope.get_counter_mode() print(f"Counter mode: {mode}")

set_counter_resolution

set_counter_resolution(digits: int) -> None

Set the resolution of the frequency counter.

Parameters:

Name Type Description Default
digits int

Number of digits (3-6)

required

Raises:

Type Description
VisaIOError

If communication fails

ValueError

If digits is out of range

Example

scope.set_counter_resolution(5) # 5-digit resolution

get_counter_resolution

get_counter_resolution() -> int

Query the resolution of the frequency counter.

Returns:

Name Type Description
int int

Number of digits (3-6)

Raises:

Type Description
VisaIOError

If communication fails

Example

digits = scope.get_counter_resolution() print(f"Counter resolution: {digits} digits")

set_counter_totalize_enable

set_counter_totalize_enable(enable: bool) -> None

Enable or disable the statistical function of the frequency counter.

Parameters:

Name Type Description Default
enable bool

True to enable totalize statistics, False to disable

required

Raises:

Type Description
VisaIOError

If communication fails

Example

scope.set_counter_totalize_enable(True) # Enable totalize

get_counter_totalize_enable

get_counter_totalize_enable() -> bool

Query the on/off status of the totalize function.

Returns:

Name Type Description
bool bool

True if enabled, False if disabled

Raises:

Type Description
VisaIOError

If communication fails

Example

if scope.get_counter_totalize_enable(): print("Totalize is enabled")

clear_counter_totalize

clear_counter_totalize() -> None

Clear the totalize statistics of the frequency counter.

Raises:

Type Description
VisaIOError

If communication fails

Example

scope.clear_counter_totalize() # Reset totalize count

get_dvm_current

get_dvm_current() -> float

Query the current voltage value under test.

Returns:

Name Type Description
float float

Current voltage value

Raises:

Type Description
VisaIOError

If communication fails

Example

voltage = scope.get_dvm_current() print(f"Current voltage: {voltage} V")

set_dvm_enable

set_dvm_enable(enable: bool) -> None

Enable or disable the digital voltmeter.

Parameters:

Name Type Description Default
enable bool

True to enable, False to disable

required

Raises:

Type Description
VisaIOError

If communication fails

Example

scope.set_dvm_enable(True) # Enable DVM

get_dvm_enable

get_dvm_enable() -> bool

Query the on/off status of the digital voltmeter.

Returns:

Name Type Description
bool bool

True if enabled, False if disabled

Raises:

Type Description
VisaIOError

If communication fails

Example

if scope.get_dvm_enable(): print("DVM is enabled")

set_dvm_source

set_dvm_source(source: int) -> None

Set the source of the digital voltmeter.

Parameters:

Name Type Description Default
source int

Channel number (1-4)

required

Raises:

Type Description
VisaIOError

If communication fails

ValueError

If source is invalid

Example

scope.set_dvm_source(2) # Set to CH2

get_dvm_source

get_dvm_source() -> int

Query the source of the digital voltmeter.

Returns:

Name Type Description
int int

Channel number (1-4)

Raises:

Type Description
VisaIOError

If communication fails

Example

source = scope.get_dvm_source() print(f"DVM source: CH{source}")

set_dvm_mode

set_dvm_mode(mode: str) -> None

Set the mode of the digital voltmeter.

Parameters:

Name Type Description Default
mode str

DVM mode (typically 'DC', 'AC', etc.)

required

Raises:

Type Description
VisaIOError

If communication fails

Example

scope.set_dvm_mode('DC') # DC voltage measurement

get_dvm_mode

get_dvm_mode() -> str

Query the mode of the digital voltmeter.

Returns:

Name Type Description
str str

DVM mode

Raises:

Type Description
VisaIOError

If communication fails

Example

mode = scope.get_dvm_mode() print(f"DVM mode: {mode}")

set_histogram_enable

set_histogram_enable(enable: bool) -> None

Enable or disable the histogram function.

Note: Histogram analysis is only supported on DHO900 series.

Parameters:

Name Type Description Default
enable bool

True to enable, False to disable

required

Raises:

Type Description
VisaIOError

If communication fails

Example

scope.set_histogram_enable(True) # Enable histogram

get_histogram_enable

get_histogram_enable() -> bool

Query the on/off status of the histogram.

Returns:

Name Type Description
bool bool

True if enabled, False if disabled

Raises:

Type Description
VisaIOError

If communication fails

Example

if scope.get_histogram_enable(): print("Histogram is enabled")

set_histogram_type

set_histogram_type(hist_type: str) -> None

Set the type of the histogram.

Parameters:

Name Type Description Default
hist_type str

Histogram type ('HORizontal' or 'VERTical')

required

Raises:

Type Description
VisaIOError

If communication fails

ValueError

If type is invalid

Example

scope.set_histogram_type('VERTical') # Vertical histogram scope.set_histogram_type('HORizontal') # Horizontal histogram

get_histogram_type

get_histogram_type() -> str

Query the type of the histogram.

Returns:

Name Type Description
str str

Histogram type ('HOR' or 'VERT')

Raises:

Type Description
VisaIOError

If communication fails

Example

hist_type = scope.get_histogram_type() print(f"Histogram type: {hist_type}")

set_histogram_source

set_histogram_source(source: int) -> None

Set the source of the histogram.

Parameters:

Name Type Description Default
source int

Channel number (1-4)

required

Raises:

Type Description
VisaIOError

If communication fails

ValueError

If source is invalid

Example

scope.set_histogram_source(1) # Set to CH1

get_histogram_source

get_histogram_source() -> int

Query the source of the histogram.

Returns:

Name Type Description
int int

Channel number (1-4)

Raises:

Type Description
VisaIOError

If communication fails

Example

source = scope.get_histogram_source() print(f"Histogram source: CH{source}")

set_histogram_height

set_histogram_height(height: int) -> None

Set the height of the histogram.

Parameters:

Name Type Description Default
height int

Height in divisions (1-4)

required

Raises:

Type Description
VisaIOError

If communication fails

ValueError

If height is out of range

Example

scope.set_histogram_height(2) # 2 divisions height

get_histogram_height

get_histogram_height() -> int

Query the height of the histogram.

Returns:

Name Type Description
int int

Height in divisions (1-4)

Raises:

Type Description
VisaIOError

If communication fails

Example

height = scope.get_histogram_height() print(f"Histogram height: {height} div")

set_histogram_range_left

set_histogram_range_left(value: float) -> None

Set the left limit of the histogram.

Parameters:

Name Type Description Default
value float

Left limit in seconds Range: (-5 × timebase + offset) to (5 × timebase + offset)

required

Raises:

Type Description
VisaIOError

If communication fails

Example

scope.set_histogram_range_left(-0.002) # -2 ms

get_histogram_range_left

get_histogram_range_left() -> float

Query the left limit of the histogram.

Returns:

Name Type Description
float float

Left limit in seconds

Raises:

Type Description
VisaIOError

If communication fails

Example

left = scope.get_histogram_range_left() print(f"Histogram left limit: {left} s")

set_histogram_range_right

set_histogram_range_right(value: float) -> None

Set the right limit of the histogram.

Parameters:

Name Type Description Default
value float

Right limit in seconds Range: (-5 × timebase + offset) to (5 × timebase + offset)

required

Raises:

Type Description
VisaIOError

If communication fails

Example

scope.set_histogram_range_right(0.002) # 2 ms

get_histogram_range_right

get_histogram_range_right() -> float

Query the right limit of the histogram.

Returns:

Name Type Description
float float

Right limit in seconds

Raises:

Type Description
VisaIOError

If communication fails

Example

right = scope.get_histogram_range_right() print(f"Histogram right limit: {right} s")

set_histogram_range_top

set_histogram_range_top(value: float) -> None

Set the top limit of the histogram.

Parameters:

Name Type Description Default
value float

Top limit in volts Range: (-4 × vertical scale - offset) to (4 × vertical scale - offset)

required

Raises:

Type Description
VisaIOError

If communication fails

Example

scope.set_histogram_range_top(2.0) # 2 V

get_histogram_range_top

get_histogram_range_top() -> float

Query the top limit of the histogram.

Returns:

Name Type Description
float float

Top limit in volts

Raises:

Type Description
VisaIOError

If communication fails

Example

top = scope.get_histogram_range_top() print(f"Histogram top limit: {top} V")

set_histogram_range_bottom

set_histogram_range_bottom(value: float) -> None

Set the bottom limit of the histogram.

Parameters:

Name Type Description Default
value float

Bottom limit in volts Range: (-4 × vertical scale - offset) to (4 × vertical scale - offset)

required

Raises:

Type Description
VisaIOError

If communication fails

Example

scope.set_histogram_range_bottom(-2.0) # -2 V

get_histogram_range_bottom

get_histogram_range_bottom() -> float

Query the bottom limit of the histogram.

Returns:

Name Type Description
float float

Bottom limit in volts

Raises:

Type Description
VisaIOError

If communication fails

Example

bottom = scope.get_histogram_range_bottom() print(f"Histogram bottom limit: {bottom} V")

get_histogram_statistics

get_histogram_statistics() -> dict

Query all histogram statistical results.

Returns:

Name Type Description
dict dict

Dictionary containing all histogram statistics with keys: - 'sum': Sum of all bins - 'peaks': Maximum hits in any single bin - 'max': Maximum value - 'min': Minimum value - 'pk_pk': Peak-to-peak (max - min) - 'mean': Average value - 'median': Median value - 'mode': Mode value - 'bin_width': Width of each bin - 'sigma': Standard deviation - 'xscale': Horizontal scale (100 × bin width)

Raises:

Type Description
VisaIOError

If communication fails

Example

stats = scope.get_histogram_statistics() print(f"Mean: {stats['mean']}, Sigma: {stats['sigma']}") print(f"Peak-to-peak: {stats['pk_pk']}")

awg_set_output_enable

awg_set_output_enable(enable: bool) -> None

Enable or disable the AWG output.

Reference: pdf_chapters/3.25.1_SOURce_OUTPut_STATe.pdf

Parameters:

Name Type Description Default
enable bool

True to enable output, False to disable

required

Raises:

Type Description
VisaIOError

If communication fails

Example

scope.awg_set_output_enable(True) # Enable AWG output

awg_get_output_enable

awg_get_output_enable() -> bool

Query the AWG output enable state.

Reference: pdf_chapters/3.25.1_SOURce_OUTPut_STATe.pdf

Returns:

Type Description
bool

True if output is enabled, False if disabled

Raises:

Type Description
VisaIOError

If communication fails

Example

enabled = scope.awg_get_output_enable()

awg_set_function

awg_set_function(function: str) -> None

Set the AWG waveform function type.

Reference: pdf_chapters/3.25.2_SOURce_FUNCtion.pdf

Parameters:

Name Type Description Default
function str

Waveform type - 'SINusoid', 'SQUare', 'RAMP', 'DC', 'NOISe', or 'ARB'

required

Raises:

Type Description
ValueError

If function type is invalid

VisaIOError

If communication fails

Example

scope.awg_set_function('SINusoid') # Sine wave scope.awg_set_function('SQUare') # Square wave

awg_get_function

awg_get_function() -> str

Query the AWG waveform function type.

Reference: pdf_chapters/3.25.2_SOURce_FUNCtion.pdf

Returns:

Type Description
str

Waveform type - 'SIN', 'SQU', 'RAMP', 'DC', 'NOIS', or 'ARB'

Raises:

Type Description
VisaIOError

If communication fails

Example

function = scope.awg_get_function()

awg_set_frequency

awg_set_frequency(frequency: float) -> None

Set the AWG output frequency.

Reference: pdf_chapters/3.25.3_SOURce_FREQuency.pdf

Parameters:

Name Type Description Default
frequency float

Frequency in Hz

required
Note

Frequency affects the valid amplitude range: - Frequency ≤ 10 MHz: Amplitude range is 2 mV to 10 V - Frequency > 10 MHz: Amplitude range is 2 mV to 5 V

Raises:

Type Description
VisaIOError

If communication fails

Example

scope.awg_set_frequency(1000) # 1 kHz

awg_get_frequency

awg_get_frequency() -> float

Query the AWG output frequency.

Reference: pdf_chapters/3.25.3_SOURce_FREQuency.pdf

Returns:

Type Description
float

Frequency in Hz

Raises:

Type Description
VisaIOError

If communication fails

Example

freq = scope.awg_get_frequency()

awg_set_amplitude

awg_set_amplitude(amplitude: float) -> None

Set the AWG output amplitude (peak-to-peak voltage).

Reference: pdf_chapters/3.25.7_SOURce_VOLTage_AMPLitude.pdf

Parameters:

Name Type Description Default
amplitude float

Amplitude in volts (Vpp)

required

Amplitude Range (frequency-dependent): - 2 mV to 10 V when frequency ≤ 10 MHz - 2 mV to 5 V when frequency > 10 MHz

Default: 6 V

Raises:

Type Description
VisaIOError

If communication fails

Example

scope.awg_set_amplitude(1.0) # 1 Vpp

awg_get_amplitude

awg_get_amplitude() -> float

Query the AWG output amplitude.

Reference: pdf_chapters/3.25.7_SOURce_VOLTage_AMPLitude.pdf

Returns:

Type Description
float

Amplitude in volts (Vpp)

Raises:

Type Description
VisaIOError

If communication fails

Example

amp = scope.awg_get_amplitude()

awg_set_offset

awg_set_offset(offset: float) -> None

Set the AWG DC offset voltage.

Reference: pdf_chapters/3.25.8_SOURce_VOLTage_OFFSet.pdf

Parameters:

Name Type Description Default
offset float

DC offset in volts

required

Offset Range (amplitude-dependent): Offset range = ± (maximum amplitude - current amplitude) / 2

Examples:
- At 5 MHz with 6 V amplitude (max 10 V): ±(10-6)/2 = ±2 V
- At 15 MHz with 3 V amplitude (max 5 V): ±(5-3)/2 = ±1 V

Default: 0 V

Raises:

Type Description
VisaIOError

If communication fails

Example

scope.awg_set_offset(0.5) # +0.5 V DC offset

awg_get_offset

awg_get_offset() -> float

Query the AWG DC offset voltage.

Reference: pdf_chapters/3.25.8_SOURce_VOLTage_OFFSet.pdf

Returns:

Type Description
float

DC offset in volts

Raises:

Type Description
VisaIOError

If communication fails

Example

offset = scope.awg_get_offset()

awg_set_phase

awg_set_phase(phase: float) -> None

Set the starting phase of the AWG waveform.

Reference: pdf_chapters/3.25.4_SOURce_PHASe.pdf

Parameters:

Name Type Description Default
phase float

Starting phase in degrees (0° to 360°)

required

Default: 0°

Applies to: All basic waveforms (Sine, Square, Ramp, Arb)

Raises:

Type Description
ValueError

If phase is out of range

VisaIOError

If communication fails

Example

scope.awg_set_phase(90) # 90° phase shift

awg_get_phase

awg_get_phase() -> float

Query the starting phase of the AWG waveform.

Reference: pdf_chapters/3.25.4_SOURce_PHASe.pdf

Returns:

Type Description
float

Starting phase in degrees

Raises:

Type Description
VisaIOError

If communication fails

Example

phase = scope.awg_get_phase()

awg_set_ramp_symmetry

awg_set_ramp_symmetry(symmetry: float) -> None

Set the symmetry of the ramp waveform.

Reference: pdf_chapters/3.25.5_SOURce_FUNCtion_RAMP_SYMMetry.pdf

Parameters:

Name Type Description Default
symmetry float

Symmetry percentage (0% to 100%) Symmetry = (rise time / period) × 100%

required

Default: 50%

Note: Only applies when waveform function is set to RAMP

Raises:

Type Description
ValueError

If symmetry is out of range

VisaIOError

If communication fails

Example

scope.awg_set_function('RAMP') scope.awg_set_ramp_symmetry(25) # 25% rise, 75% fall

awg_get_ramp_symmetry

awg_get_ramp_symmetry() -> float

Query the symmetry of the ramp waveform.

Reference: pdf_chapters/3.25.5_SOURce_FUNCtion_RAMP_SYMMetry.pdf

Returns:

Type Description
float

Symmetry percentage (0% to 100%)

Raises:

Type Description
VisaIOError

If communication fails

Example

symmetry = scope.awg_get_ramp_symmetry()

awg_set_square_duty

awg_set_square_duty(duty: float) -> None

Set the duty cycle of the square waveform.

Reference: pdf_chapters/3.25.6_SOURce_FUNCtion_SQUare_DUTY.pdf

Parameters:

Name Type Description Default
duty float

Duty cycle percentage (0 to 100) Duty cycle = (high time / period) × 100%

required

Default: 50

Note: Only applies when waveform function is set to SQUare

Raises:

Type Description
ValueError

If duty cycle is out of range

VisaIOError

If communication fails

Example

scope.awg_set_function('SQUare') scope.awg_set_square_duty(25) # 25% high, 75% low

awg_get_square_duty

awg_get_square_duty() -> float

Query the duty cycle of the square waveform.

Reference: pdf_chapters/3.25.6_SOURce_FUNCtion_SQUare_DUTY.pdf

Returns:

Type Description
float

Duty cycle percentage (0 to 100)

Raises:

Type Description
VisaIOError

If communication fails

Example

duty = scope.awg_get_square_duty()

awg_set_modulation_enable

awg_set_modulation_enable(enable: bool) -> None

Enable or disable AWG modulation.

Reference: pdf_chapters/3.25.9_SOURce_MOD_STATe.pdf

Parameters:

Name Type Description Default
enable bool

True to enable modulation, False to disable

required

Raises:

Type Description
VisaIOError

If communication fails

Example

scope.awg_set_modulation_enable(True)

awg_get_modulation_enable

awg_get_modulation_enable() -> bool

Query the AWG modulation enable state.

Reference: pdf_chapters/3.25.9_SOURce_MOD_STATe.pdf

Returns:

Type Description
bool

True if modulation is enabled, False if disabled

Raises:

Type Description
VisaIOError

If communication fails

Example

enabled = scope.awg_get_modulation_enable()

awg_set_modulation_type

awg_set_modulation_type(mod_type: str) -> None

Set the AWG modulation type.

Reference: pdf_chapters/3.25.10_SOURce_MOD_TYPe.pdf

Parameters:

Name Type Description Default
mod_type str

Modulation type - 'AM', 'FM', or 'PM' AM = Amplitude Modulation FM = Frequency Modulation PM = Phase Modulation

required

Default: 'AM'

Raises:

Type Description
ValueError

If modulation type is invalid

VisaIOError

If communication fails

Example

scope.awg_set_modulation_type('AM') # Amplitude modulation

awg_get_modulation_type

awg_get_modulation_type() -> str

Query the AWG modulation type.

Reference: pdf_chapters/3.25.10_SOURce_MOD_TYPe.pdf

Returns:

Type Description
str

Modulation type - 'AM', 'FM', or 'PM'

Raises:

Type Description
VisaIOError

If communication fails

Example

mod_type = scope.awg_get_modulation_type()

awg_set_am_depth

awg_set_am_depth(depth: float) -> None

Set the AM (Amplitude Modulation) depth.

Reference: pdf_chapters/3.25.11_SOURce_MOD_AM_DEPTh.pdf

Parameters:

Name Type Description Default
depth float

Modulation depth percentage (0% to 120%) 0% = amplitude is half of carrier 100% = amplitude equals carrier

100% = envelope distortion

required

Default: 100%

Raises:

Type Description
ValueError

If depth is out of range

VisaIOError

If communication fails

Example

scope.awg_set_am_depth(80) # 80% modulation depth

awg_get_am_depth

awg_get_am_depth() -> float

Query the AM modulation depth.

Reference: pdf_chapters/3.25.11_SOURce_MOD_AM_DEPTh.pdf

Returns:

Type Description
float

Modulation depth percentage

Raises:

Type Description
VisaIOError

If communication fails

Example

depth = scope.awg_get_am_depth()

awg_set_am_frequency

awg_set_am_frequency(frequency: float) -> None

Set the AM modulation frequency.

Reference: pdf_chapters/3.25.12_SOURce_MOD_AM_INTernal_FREQuency.pdf

Parameters:

Name Type Description Default
frequency float

Modulation frequency in Hz (2 mHz to 1 MHz)

required

Default: 100 Hz

Raises:

Type Description
ValueError

If frequency is out of range

VisaIOError

If communication fails

Example

scope.awg_set_am_frequency(1000) # 1 kHz modulation

awg_get_am_frequency

awg_get_am_frequency() -> float

Query the AM modulation frequency.

Reference: pdf_chapters/3.25.12_SOURce_MOD_AM_INTernal_FREQuency.pdf

Returns:

Type Description
float

Modulation frequency in Hz

Raises:

Type Description
VisaIOError

If communication fails

Example

freq = scope.awg_get_am_frequency()

awg_set_am_function

awg_set_am_function(function: str) -> None

Set the AM modulation waveform type.

Reference: pdf_chapters/3.25.13_SOURce_MOD_AM_INTernal_FUNCtion.pdf

Parameters:

Name Type Description Default
function str

Modulation waveform - 'SINusoid', 'SQUare', 'TRIangle', 'UPRamp', 'DNRamp', or 'NOISe'

required

Default: 'SINusoid'

Raises:

Type Description
ValueError

If function is invalid

VisaIOError

If communication fails

Example

scope.awg_set_am_function('SQUare')

awg_get_am_function

awg_get_am_function() -> str

Query the AM modulation waveform type.

Reference: pdf_chapters/3.25.13_SOURce_MOD_AM_INTernal_FUNCtion.pdf

Returns:

Type Description
str

Modulation waveform - 'SIN', 'SQU', 'TRI', 'UPR', 'DNR', or 'NOIS'

Raises:

Type Description
VisaIOError

If communication fails

Example

function = scope.awg_get_am_function()

awg_set_fm_deviation

awg_set_fm_deviation(deviation: float) -> None

Set the FM (Frequency Modulation) frequency deviation.

Reference: pdf_chapters/3.25.14_SOURce_MOD_FM_DEViation.pdf

Parameters:

Name Type Description Default
deviation float

Frequency deviation in Hz (2 mHz to carrier frequency) Peak variation in frequency from carrier

required

Default: 1 kHz

Raises:

Type Description
ValueError

If deviation is negative

VisaIOError

If communication fails

Example

scope.awg_set_fm_deviation(5000) # ±5 kHz deviation

awg_get_fm_deviation

awg_get_fm_deviation() -> float

Query the FM frequency deviation.

Reference: pdf_chapters/3.25.14_SOURce_MOD_FM_DEViation.pdf

Returns:

Type Description
float

Frequency deviation in Hz

Raises:

Type Description
VisaIOError

If communication fails

Example

deviation = scope.awg_get_fm_deviation()

awg_set_fm_frequency

awg_set_fm_frequency(frequency: float) -> None

Set the FM modulation frequency.

Reference: pdf_chapters/3.25.15_SOURce_MOD_FM_INTernal_FREQuency.pdf

Parameters:

Name Type Description Default
frequency float

Modulation frequency in Hz (2 mHz to 1 MHz)

required

Default: 100 Hz

Raises:

Type Description
ValueError

If frequency is out of range

VisaIOError

If communication fails

Example

scope.awg_set_fm_frequency(500) # 500 Hz modulation

awg_get_fm_frequency

awg_get_fm_frequency() -> float

Query the FM modulation frequency.

Reference: pdf_chapters/3.25.15_SOURce_MOD_FM_INTernal_FREQuency.pdf

Returns:

Type Description
float

Modulation frequency in Hz

Raises:

Type Description
VisaIOError

If communication fails

Example

freq = scope.awg_get_fm_frequency()

awg_set_fm_function

awg_set_fm_function(function: str) -> None

Set the FM modulation waveform type.

Reference: pdf_chapters/3.25.16_SOURce_MOD_FM_INTernal_FUNCtion.pdf

Parameters:

Name Type Description Default
function str

Modulation waveform - 'SINusoid', 'SQUare', 'TRIangle', 'UPRamp', 'DNRamp', or 'NOISe'

required

Default: 'SINusoid'

Raises:

Type Description
ValueError

If function is invalid

VisaIOError

If communication fails

Example

scope.awg_set_fm_function('TRIangle')

awg_get_fm_function

awg_get_fm_function() -> str

Query the FM modulation waveform type.

Reference: pdf_chapters/3.25.16_SOURce_MOD_FM_INTernal_FUNCtion.pdf

Returns:

Type Description
str

Modulation waveform - 'SIN', 'SQU', 'TRI', 'UPR', 'DNR', or 'NOIS'

Raises:

Type Description
VisaIOError

If communication fails

Example

function = scope.awg_get_fm_function()

awg_set_pm_deviation

awg_set_pm_deviation(deviation: float) -> None

Set the PM (Phase Modulation) phase deviation.

Reference: pdf_chapters/3.25.17_SOURce_MOD_PM_DEViation.pdf

Parameters:

Name Type Description Default
deviation float

Phase deviation in degrees (0° to 360°) Peak variation in phase from carrier

required

Default: 90°

Raises:

Type Description
ValueError

If deviation is out of range

VisaIOError

If communication fails

Example

scope.awg_set_pm_deviation(180) # ±180° deviation

awg_get_pm_deviation

awg_get_pm_deviation() -> float

Query the PM phase deviation.

Reference: pdf_chapters/3.25.17_SOURce_MOD_PM_DEViation.pdf

Returns:

Type Description
float

Phase deviation in degrees

Raises:

Type Description
VisaIOError

If communication fails

Example

deviation = scope.awg_get_pm_deviation()

awg_set_pm_frequency

awg_set_pm_frequency(frequency: float) -> None

Set the PM modulation frequency.

Reference: pdf_chapters/3.25.18_SOURce_MOD_PM_INTernal_FREQuency.pdf

Parameters:

Name Type Description Default
frequency float

Modulation frequency in Hz (2 mHz to 1 MHz)

required

Default: 100 Hz

Raises:

Type Description
ValueError

If frequency is out of range

VisaIOError

If communication fails

Example

scope.awg_set_pm_frequency(250) # 250 Hz modulation

awg_get_pm_frequency

awg_get_pm_frequency() -> float

Query the PM modulation frequency.

Reference: pdf_chapters/3.25.18_SOURce_MOD_PM_INTernal_FREQuency.pdf

Returns:

Type Description
float

Modulation frequency in Hz

Raises:

Type Description
VisaIOError

If communication fails

Example

freq = scope.awg_get_pm_frequency()

awg_set_pm_function

awg_set_pm_function(function: str) -> None

Set the PM modulation waveform type.

Reference: pdf_chapters/3.25.19_SOURce_MOD_PM_INTernal_FUNCtion.pdf

Parameters:

Name Type Description Default
function str

Modulation waveform - 'SINusoid', 'SQUare', 'TRIangle', 'UPRamp', 'DNRamp', or 'NOISe'

required

Default: 'SINusoid'

Raises:

Type Description
ValueError

If function is invalid

VisaIOError

If communication fails

Example

scope.awg_set_pm_function('SQUare')

awg_get_pm_function

awg_get_pm_function() -> str

Query the PM modulation waveform type.

Reference: pdf_chapters/3.25.19_SOURce_MOD_PM_INTernal_FUNCtion.pdf

Returns:

Type Description
str

Modulation waveform - 'SIN', 'SQU', 'TRI', 'UPR', 'DNR', or 'NOIS'

Raises:

Type Description
VisaIOError

If communication fails

Example

function = scope.awg_get_pm_function()

awg_configure_simple

awg_configure_simple(function: str, frequency: float, amplitude: float, offset: float = 0.0, enable: bool = True) -> None

High-level method to quickly configure and enable the AWG.

This is a convenience method that sets up basic AWG parameters in one call.

Parameters:

Name Type Description Default
function str

Waveform type - 'SINusoid', 'SQUare', 'RAMP', 'DC', 'NOISe'

required
frequency float

Output frequency in Hz

required
amplitude float

Output amplitude in volts (Vpp)

required
offset float

DC offset in volts (default: 0.0)

0.0
enable bool

Enable output after configuration (default: True)

True

Raises:

Type Description
VisaIOError

If communication fails

Example

Configure 1 kHz sine wave, 2 Vpp, no offset

scope.awg_configure_simple('SINusoid', 1000, 2.0)

Configure 10 kHz square wave, 5 Vpp, +1V offset

scope.awg_configure_simple('SQUare', 10000, 5.0, offset=1.0)


Keysight DSOX1204G

4-channel 70 MHz oscilloscope with built-in waveform generator.

Keysight_DSOX1204G

Bases: DeviceManager

Driver for Keysight InfiniiVision 1000 X-Series oscilloscope.

Model: DSOX1204G (4-channel, 70 MHz, with WaveGen)

connect

connect()

Connect to the Keysight DSOX1204G oscilloscope.

disconnect

disconnect()

Disconnect from the oscilloscope.

run

run() -> None

Start running the oscilloscope (continuous acquisition).

stop

stop() -> None

Stop the oscilloscope acquisition.

single

single() -> None

Set oscilloscope to single trigger mode and arm for one acquisition.

autoset

autoset() -> None

Perform an autoscale on the oscilloscope (Keysight uses AUToscale).

force_trigger

force_trigger() -> None

Generate a trigger signal forcefully (Keysight uses TRIGger:FORCe).

enable_channel

enable_channel(channel: int) -> None

Enable a channel.

disable_channel

disable_channel(channel: int) -> None

Disable a channel.

enable_all_channels

enable_all_channels() -> None

Enable all analog channels.

disable_all_channels

disable_all_channels() -> None

Disable all analog channels.

set_vertical_scale

set_vertical_scale(channel: int, volts_per_div: float, offset: float = 0.0) -> None

Set vertical scale and offset for a channel.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
volts_per_div float

Vertical scale in volts per division

required
offset float

Vertical offset in volts

0.0

set_vertical_position

set_vertical_position(channel: int, position: float) -> None

Set vertical position (offset) of the channel.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
position float

Vertical offset in volts

required

get_vertical_position

get_vertical_position(channel: int) -> float

Get vertical position (offset) of the channel.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required

Returns:

Name Type Description
float float

Current vertical offset in volts

move_vertical

move_vertical(channel: int, delta: float) -> None

Move a channel vertically by a delta amount.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
delta float

Amount to move in volts (positive = up, negative = down)

required

set_coupling

set_coupling(channel: int, coupling: str) -> None

Set channel coupling.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
coupling str

'DC' or 'AC' (Keysight 1000X does NOT support GND)

required

set_probe_attenuation

set_probe_attenuation(channel: int, ratio: float) -> None

Set probe attenuation ratio.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
ratio float

Probe attenuation ratio (e.g., 1, 10, 100)

required

set_channel_label

set_channel_label(channel: int, label: str, show: bool = True) -> None

Set channel label text.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
label str

Label text to display

required
show bool

True to show label (Keysight shows label when set)

True

invert_channel

invert_channel(channel: int, enable: bool) -> None

Invert the waveform display.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
enable bool

True to invert waveform, False for normal display

required

set_bandwidth_limit

set_bandwidth_limit(channel: int, limit: str) -> None

Set bandwidth limit for a channel.

Keysight 1000X uses ON/OFF instead of 20M/OFF. For compatibility, '20M' is mapped to 'ON'.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
limit str

'20M' or 'ON' for 20MHz limit, 'OFF' to disable

required

set_horizontal_scale

set_horizontal_scale(seconds_per_div: float) -> None

Set horizontal timebase scale.

Parameters:

Name Type Description Default
seconds_per_div float

Time per division in seconds

required

set_horizontal_offset

set_horizontal_offset(offset: float) -> None

Set horizontal offset (time position).

Note: Keysight uses :TIMebase:POSition (not OFFSet).

Parameters:

Name Type Description Default
offset float

Time offset in seconds

required

set_horizontal_position

set_horizontal_position(offset: float) -> None

Alias for set_horizontal_offset.

get_horizontal_offset

get_horizontal_offset() -> float

Get the current horizontal offset (time position).

Returns:

Name Type Description
float float

Time offset in seconds

move_horizontal

move_horizontal(delta: float) -> None

Move the horizontal position by a delta amount.

Parameters:

Name Type Description Default
delta float

Amount to move in seconds (positive = right, negative = left)

required

configure_trigger

configure_trigger(channel: int, level: float, slope: str = 'RISE', mode: str = 'AUTO') -> None

Configure edge trigger.

Parameters:

Name Type Description Default
channel int

Trigger source channel (1-4)

required
level float

Trigger level in volts

required
slope str

'RISE', 'FALL', 'RFALL', or 'EITHER'

'RISE'
mode str

'AUTO', 'NORMAL', or 'SINGLE'

'AUTO'

set_trigger_sweep

set_trigger_sweep(sweep: str) -> None

Set trigger sweep mode.

Parameters:

Name Type Description Default
sweep str

'AUTO' or 'NORMal'

required

get_trigger_status

get_trigger_status() -> str

Query current trigger status.

Keysight 1000X does not have :TRIGger:STATus? -- uses :TER? instead. :TER? returns 1 if a trigger event has occurred, 0 otherwise.

Returns:

Name Type Description
str str

'TD' if triggered, 'RUN' otherwise

wait_for_stop

wait_for_stop(timeout: float = 10.0) -> bool

Poll trigger status until the scope has triggered.

Call after single() to block until the trigger fires.

Parameters:

Name Type Description Default
timeout float

Maximum seconds to wait (default 10.0)

10.0

Returns:

Name Type Description
bool bool

True if scope triggered, False if timed out

measure

measure(channel: int, measurement_type: str) -> float

Measure any waveform parameter.

Keysight uses :MEASure:{TYPE}? CHANnel{n} format (not :MEASure:ITEM?).

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
measurement_type str

Measurement parameter (case-insensitive)

required

Returns:

Name Type Description
float float

Measurement value

measure_bnf

measure_bnf(channel: int, measurement_type: str) -> float

Alias for measure() for compatibility with REPL code.

configure_measurement

configure_measurement(channel: int, measurement_type: str) -> None

Configure a measurement slot without querying the result.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
measurement_type str

Measurement parameter

required

clear_measurements

clear_measurements() -> None

Clear all measurement items from the display.

measure_delay

measure_delay(ch1: int, ch2: int, edge1: str = 'RISE', edge2: str = 'RISE', direction: str = 'FORWARDS') -> float

Measure delay between two channels.

Parameters:

Name Type Description Default
ch1 int

First channel (1-4)

required
ch2 int

Second channel (1-4)

required
edge1 str

Edge type for ch1 ('RISE' or 'FALL')

'RISE'
edge2 str

Edge type for ch2 ('RISE' or 'FALL')

'RISE'
direction str

Direction ('FORWARDS' or 'BACKWARDS')

'FORWARDS'

Returns:

Name Type Description
float float

Delay in seconds

measure_vpp

measure_vpp(channel: int) -> float

Measure peak-to-peak voltage.

measure_vrms

measure_vrms(channel: int) -> float

Measure RMS voltage.

measure_frequency

measure_frequency(channel: int) -> float

Measure frequency in Hz.

measure_period

measure_period(channel: int) -> float

Measure period in seconds.

measure_amplitude

measure_amplitude(channel: int) -> float

Measure amplitude (Vtop - Vbase).

get_waveform_preamble

get_waveform_preamble() -> dict

Get all waveform scaling parameters.

Returns:

Name Type Description
dict dict

Waveform parameters with 10 comma-separated values: - format, type, points, count - xincrement, xorigin, xreference - yincrement, yorigin, yreference

acquire_waveform

acquire_waveform(channel: int, mode: str = 'NORMAL') -> WaveformData

Acquire complete waveform with proper scaling.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
mode str

Acquisition mode ('NORMAL', 'MAXIMUM', 'RAW')

'NORMAL'

Returns:

Type Description
WaveformData

WaveformData object with time and voltage arrays

save_waveform_csv

save_waveform_csv(channel: int, filename: str, max_points: int | None = None, time_window: float | None = None) -> None

Save waveform from a single channel to a CSV file.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
filename str

Output CSV filename

required
max_points int | None

Maximum number of points to save

None
time_window float | None

Time window in seconds to save

None

save_waveforms_csv

save_waveforms_csv(channels: list, filename: str, max_points: int | None = None, time_window: float | None = None) -> None

Save waveforms from multiple channels to a single CSV file.

Parameters:

Name Type Description Default
channels list

List of channel numbers to capture

required
filename str

Output CSV filename

required
max_points int | None

Maximum number of points to save

None
time_window float | None

Time window in seconds to save

None

get_screenshot

get_screenshot() -> bytes

Capture the current screen image as PNG data.

Returns:

Name Type Description
bytes bytes

PNG image data

clear_display

clear_display() -> None

Clear all waveforms on the screen.

set_waveform_brightness

set_waveform_brightness(brightness: int) -> None

Set the brightness of waveforms on the screen.

Parameters:

Name Type Description Default
brightness int

Brightness level in percentage (1-100)

required

set_persistence

set_persistence(time_val: str) -> None

Set the waveform persistence time.

Parameters:

Name Type Description Default
time_val str

Persistence time value

required

set_display_type

set_display_type(display_type: str) -> None

Set the display type (always vectors on 1000X).

Parameters:

Name Type Description Default
display_type str

Display type (e.g., 'VECTORS')

required

set_acquisition_type

set_acquisition_type(acq_type: str) -> None

Set the acquisition type.

Parameters:

Name Type Description Default
acq_type str

'NORMal', 'AVERage', 'HRESolution', or 'PEAK'

required

set_average_count

set_average_count(count: int) -> None

Set the number of averages for AVERAGE acquisition mode.

Parameters:

Name Type Description Default
count int

Number of averages

required

get_sample_rate

get_sample_rate() -> float

Query the current sample rate.

Returns:

Name Type Description
float float

Sample rate in Sa/s

awg_set_output_enable

awg_set_output_enable(enable: bool) -> None

Enable or disable the AWG output.

Parameters:

Name Type Description Default
enable bool

True to enable output, False to disable

required

awg_set_function

awg_set_function(function: str) -> None

Set the AWG waveform function type.

Parameters:

Name Type Description Default
function str

'SINusoid', 'SQUare', 'RAMP', 'PULSe', 'DC', or 'NOISe'

required

awg_set_frequency

awg_set_frequency(freq: float) -> None

Set the AWG output frequency.

Parameters:

Name Type Description Default
freq float

Frequency in Hz

required

awg_set_amplitude

awg_set_amplitude(amp: float) -> None

Set the AWG output amplitude.

Parameters:

Name Type Description Default
amp float

Amplitude in volts (Vpp)

required

awg_set_offset

awg_set_offset(offset: float) -> None

Set the AWG DC offset.

Parameters:

Name Type Description Default
offset float

DC offset in volts

required

awg_set_square_duty

awg_set_square_duty(duty: float) -> None

Set the AWG square wave duty cycle.

Parameters:

Name Type Description Default
duty float

Duty cycle percentage

required

awg_set_ramp_symmetry

awg_set_ramp_symmetry(sym: float) -> None

Set the AWG ramp symmetry.

Parameters:

Name Type Description Default
sym float

Symmetry percentage

required

awg_configure_simple

awg_configure_simple(func: str, freq: float, amp: float, offset: float = 0.0, enable: bool = True) -> None

High-level method to quickly configure and enable the AWG.

Parameters:

Name Type Description Default
func str

Waveform type

required
freq float

Output frequency in Hz

required
amp float

Output amplitude in volts (Vpp)

required
offset float

DC offset in volts (default: 0.0)

0.0
enable bool

Enable output after configuration (default: True)

True

set_dvm_enable

set_dvm_enable(enable: bool) -> None

Enable or disable the digital voltmeter.

Parameters:

Name Type Description Default
enable bool

True to enable, False to disable

required

get_dvm_current

get_dvm_current() -> float

Query the current voltage value from DVM.

Returns:

Name Type Description
float float

Current voltage value

set_dvm_source

set_dvm_source(source: int) -> None

Set the DVM source channel.

Parameters:

Name Type Description Default
source int

Channel number (1-4)

required

set_dvm_mode

set_dvm_mode(mode: str) -> None

Set the DVM mode.

Parameters:

Name Type Description Default
mode str

DVM mode (e.g., 'DC', 'ACRMs', 'DCRMS')

required

enable_math_channel

enable_math_channel(math_ch: int = 1, enable: bool = True) -> None

Enable or disable the math channel.

Keysight 1000X has a single math channel via :FUNCtion subsystem.

Parameters:

Name Type Description Default
math_ch int

Math channel number (ignored, Keysight 1000X has one math channel)

1
enable bool

True to enable, False to disable

True

configure_math_operation

configure_math_operation(math_ch: int, operation: str, source1: str, source2: str = None) -> None

Configure math channel for arithmetic operation.

Parameters:

Name Type Description Default
math_ch int

Math channel (ignored, Keysight 1000X has one math channel)

required
operation str

'ADD', 'SUBTRACT', 'MULTIPLY'

required
source1 str

Source A (e.g., 'CHAN1')

required
source2 str

Source B (e.g., 'CHAN2')

None

configure_math_function

configure_math_function(math_ch: int, function: str, source: str) -> None

Configure math channel for a function operation.

Parameters:

Name Type Description Default
math_ch int

Math channel (ignored)

required
function str

'INTG', 'DIFF', 'SQRT', etc.

required
source str

Source channel (e.g., 'CHAN1')

required

configure_fft

configure_fft(math_ch: int, source: str, window: str = 'RECT') -> None

Configure math channel for FFT analysis.

Parameters:

Name Type Description Default
math_ch int

Math channel (ignored)

required
source str

Source channel (e.g., 'CHAN1')

required
window str

FFT window ('RECT', 'HANN', 'FLAT', 'BLAC')

'RECT'

set_math_scale

set_math_scale(math_ch: int, scale: float, offset: float = None) -> None

Set vertical scale and offset for math channel.

Parameters:

Name Type Description Default
math_ch int

Math channel (ignored)

required
scale float

Vertical scale (V/div)

required
offset float

Vertical offset (optional)

None

set_mask_enable

set_mask_enable(enable: bool) -> None

Enable or disable mask testing.

Parameters:

Name Type Description Default
enable bool

True to enable, False to disable

required

get_mask_enable

get_mask_enable() -> bool

Query whether mask testing is enabled.

Returns:

Name Type Description
bool bool

True if enabled, False if disabled

set_mask_source

set_mask_source(channel: int) -> None

Set the source channel for mask testing.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required

get_mask_source

get_mask_source() -> str

Query the source channel for mask testing.

Returns:

Name Type Description
str str

Source channel string

set_mask_tolerance_x

set_mask_tolerance_x(tol: float) -> None

Set the horizontal tolerance for the auto mask.

Parameters:

Name Type Description Default
tol float

Horizontal tolerance in divisions

required

set_mask_tolerance_y

set_mask_tolerance_y(tol: float) -> None

Set the vertical tolerance for the auto mask.

Parameters:

Name Type Description Default
tol float

Vertical tolerance in divisions

required

create_mask

create_mask() -> None

Create a mask from the current waveform using auto mask.

start_mask_test

start_mask_test() -> None

Start the mask test.

stop_mask_test

stop_mask_test() -> None

Stop the mask test.

get_mask_failed_count

get_mask_failed_count() -> int

Query the number of waveforms that failed the mask test.

Returns:

Name Type Description
int int

Number of failed waveforms

get_mask_total_count

get_mask_total_count() -> int

Query the total number of waveforms tested.

Returns:

Name Type Description
int int

Total number of waveforms tested

get_mask_passed_count

get_mask_passed_count() -> int

Get the number of waveforms that passed the mask test.

Returns:

Name Type Description
int int

Number of passed waveforms (total - failed)

get_mask_statistics

get_mask_statistics() -> dict

Query all mask test statistics.

Returns:

Name Type Description
dict dict

Dictionary with 'passed', 'failed', 'total' counts

reset_mask_statistics

reset_mask_statistics() -> None

Reset the mask test statistics counters.

get_mask_test_status

get_mask_test_status() -> str

Query the mask test status.

Returns:

Name Type Description
str str

'RUN' if enabled, 'STOP' if disabled

reset

reset() -> None

Reset oscilloscope to factory default settings.

clear_status

clear_status() -> None

Clear status byte and error queue.

get_error

get_error() -> str

Read the most recent error from the system error queue.

Returns:

Name Type Description
str str

Error message string


Tektronix MSO2024

4-channel 200 MHz mixed signal oscilloscope.

Tektronix_MSO2024

Bases: DeviceManager

Driver for Tektronix MSO2000 Series (Legacy).

Model: MSO2024 Firmware: v1.56 (Verified Legacy)

get_error

get_error()

Reads the most recent error from the system error queue.

disable_all_channels

disable_all_channels()

Disable all channels (Analog + Math).

enable_all_channels

enable_all_channels()

Enable all analog channels.

change_channel_status

change_channel_status(channel, status: bool)

Enable or disable the specified channel.

set_channel_label

set_channel_label(channel, label: str)

Sets the label for a specific channel (Max 30 chars).

set_probe_attenuation

set_probe_attenuation(channel, attenuation: float)

Sets the probe attenuation (Legacy MSO2000 uses PRObe:GAIN).

set_coupling

set_coupling(channel, coupling: str)

Set channel input coupling.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
coupling str

'DC', 'AC', or 'GND'

required

set_horizontal_scale

set_horizontal_scale(scale)

Set the horizontal scale (seconds per division).

set_horizontal_offset

set_horizontal_offset(offset: float) -> None

Set horizontal offset (time position) in seconds.

Enables delay mode and sets the delay time so the trigger point is shifted by the given offset. Negative = earlier time visible; positive = later time visible; zero = trigger at center.

get_horizontal_offset

get_horizontal_offset() -> float

Return the current horizontal delay time in seconds.

set_horizontal_position

set_horizontal_position(position: float)

Set the horizontal position (percentage 0-100).

Parameters:

Name Type Description Default
position float

Position as percentage (0-100)

required

get_horizontal_position

get_horizontal_position()

Get the current horizontal position.

Returns:

Name Type Description
float

Position as percentage (0-100)

move_horizontal

move_horizontal(delta: float)

Move the horizontal position by a delta amount.

Parameters:

Name Type Description Default
delta float

Amount to move in percentage (positive = right, negative = left)

required

set_acquisition_mode

set_acquisition_mode(mode: str, num_averages: int = 16)

Sets the acquisition mode. Legacy MSO2000 Supports: SAMPLE, AVERAGE, PEAKDETECT. (HIRES/ENVELOPE might be restricted on some older firmwares, but usually present).

run

run()

Start/resume acquisition (run the oscilloscope).

stop

stop()

Stop/pause acquisition (stop the oscilloscope).

single

single()

Arm single-shot acquisition. The scope will wait for a trigger event, capture one acquisition, then stop. Perfect for capturing specific events.

get_acquisition_state

get_acquisition_state()

Get the current acquisition state.

Returns:

Name Type Description
int

1 if running, 0 if stopped

is_running

is_running()

Check if the oscilloscope is currently running.

Returns:

Name Type Description
bool

True if running, False if stopped

set_acquisition_stop_after

set_acquisition_stop_after(mode: str)

Set when acquisition stops.

Parameters:

Name Type Description Default
mode str

'RUNSTop' for continuous or 'SEQuence' for single-shot

required

set_vertical_scale

set_vertical_scale(channel, scale, position=0.0)

Set the vertical scale (Volts/div) and position (divs).

set_vertical_position

set_vertical_position(channel, position: float)

Set the vertical position of a channel (in divisions from center).

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
position float

Position in divisions (positive = up, negative = down)

required

get_vertical_position

get_vertical_position(channel)

Get the current vertical position of a channel.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required

Returns:

Name Type Description
float

Position in divisions

move_vertical

move_vertical(channel, delta: float)

Move a channel vertically by a delta amount.

Parameters:

Name Type Description Default
channel int

Channel number (1-4)

required
delta float

Amount to move in divisions (positive = up, negative = down)

required

configure_trigger

configure_trigger(source_channel, level, slope='RISE', mode='AUTO')

Configure the Edge Trigger parameters.

configure_math

configure_math(expression: str, scale: float = None, position: float = None)

Configures the Math waveform.

measure_math_bnf

measure_math_bnf(measure_type)

Performs a measurement specifically on the Math waveform. Uses Legacy IMMed command (no badges).

configure_measurement

configure_measurement(channel: int, measurement_type: str) -> None

Configure an immediate measurement without querying the result.

Sets MEASUrement:IMMed:SOUrce1 and MEASUrement:IMMed:TYPe so the measurement is ready to query with measure_bnf() after a trigger.

measure_bnf

measure_bnf(channel, measure_type)

Measure a basic measurement function (BNF) on the specified channel. Uses Legacy IMMed command (no badges).

get_waveform_data

get_waveform_data(channel)

Fetch raw unscaled waveform data points from the scope.

get_waveform_scaled

get_waveform_scaled(channel)

Fetch waveform data and scale it to Time (s) and Voltage (V).

Returns:

Name Type Description
tuple

(time_values, voltage_values)

save_waveform_csv

save_waveform_csv(channel, filename, max_points=None, time_window=None)

Saves the waveform of the specified channel to a CSV file.

Parameters:

Name Type Description Default
channel int

Channel to capture.

required
filename str

Output filename (e.g., 'data.csv').

required
max_points int

Maximum number of points to save. If None, saves all.

None
time_window float

Time window in seconds to save. If None, saves all.

None

save_waveforms_csv

save_waveforms_csv(channels, filename, max_points=None, time_window=None)

Saves waveforms from multiple channels to a single CSV file.

Parameters:

Name Type Description Default
channels list

List of channel numbers to capture (e.g., [1, 3]).

required
filename str

Output filename (e.g., 'data.csv').

required
max_points int

Maximum number of points to save. If None, saves all.

None
time_window float

Time window in seconds to save. If None, saves all.

None

measure_peak_to_peak

measure_peak_to_peak(channel)

Helper: Measure Peak-to-Peak voltage.

measure_frequency

measure_frequency(channel)

Helper: Measure Frequency.

measure_rms

measure_rms(channel)

Helper: Measure RMS voltage.

measure_mean

measure_mean(channel)

Helper: Measure Mean voltage.

measure_max

measure_max(channel)

Helper: Measure Maximum voltage.

measure_min

measure_min(channel)

Helper: Measure Minimum voltage.

measure_period

measure_period(channel)

Helper: Measure Period.

measure_delay

measure_delay(source1_channel, source2_channel, edge1='RISE', edge2='RISE', direction='FORWards')

Measure the time delay between two channels.

Parameters:

Name Type Description Default
source1_channel int

The starting channel.

required
source2_channel int

The ending channel.

required
edge1 str

'RISE' or 'FALL' for the first source.

'RISE'
edge2 str

'RISE' or 'FALL' for the second source.

'RISE'
direction str

'FORWards' or 'BACKwards' (default: FORWards)

'FORWards'

measure_rise_time

measure_rise_time(channel)

Helper: Measure Rise Time.

measure_fall_time

measure_fall_time(channel)

Helper: Measure Fall Time.

autoset

autoset()

Perform an autoset on the oscilloscope.