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.
set_vertical_scale ¶
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 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 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 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 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 ¶
Alias for set_probe_ratio.
set_channel_position ¶
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 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 ¶
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 ¶
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 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 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 ¶
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 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 (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 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/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 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 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/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 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 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 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.
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 ¶
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.
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 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 ¶
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 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 ¶
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 ¶
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 ¶
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 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 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 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 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 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 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 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 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 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_duty_cycle ¶
Measure positive duty cycle percentage.
measure_bnf ¶
Measure a parameter (alias for compatibility with existing REPL code). BNF = "Built-iN Function" measurement.
measure_delay ¶
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 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 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 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 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 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 |
set_track_cursor_positions ¶
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 |
set_track_cursor_mode ¶
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 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 (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 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 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 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 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 |
configure_math_function ¶
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 |
configure_fft ¶
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.
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 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
set_average_count ¶
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)
set_memory_depth ¶
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
get_memory_depth ¶
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 ¶
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 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 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 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
set_persistence ¶
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
get_screenshot ¶
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 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%
set_grid_brightness ¶
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%
save_screenshot_to_scope ¶
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
save_setup ¶
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
load_setup ¶
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()
save_waveform_to_scope ¶
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
get_identity ¶
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 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.
clear_status ¶
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)
operation_complete ¶
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
get_status_byte ¶
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
self_test ¶
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 ¶
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
autoset_peak ¶
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
set_autoset_enable ¶
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)
get_autoset_enable ¶
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 ¶
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 |
get_beeper_enable ¶
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 ¶
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 ¶
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 |
get_front_panel_lock ¶
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 ¶
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 ¶
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 ¶
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 |
get_recording_enable ¶
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 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 |
get_recording_frames ¶
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 ¶
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 waveform recording.
Reference: pdf_chapters/3.19.3_RECord_WRECord_OPERate.pdf
Raises:
| Type | Description |
|---|---|
VisaIOError
|
If communication fails |
stop_recording ¶
Stop waveform recording.
Reference: pdf_chapters/3.19.3_RECord_WRECord_OPERate.pdf
Raises:
| Type | Description |
|---|---|
VisaIOError
|
If communication fails |
get_recording_status ¶
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 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 |
get_playback_current_frame ¶
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 automatic playback of recorded waveforms.
Reference: pdf_chapters/3.19.20_RECord_WREPlay_OPERate.pdf
Raises:
| Type | Description |
|---|---|
VisaIOError
|
If communication fails |
stop_playback ¶
Stop automatic playback of recorded waveforms.
Reference: pdf_chapters/3.19.20_RECord_WREPlay_OPERate.pdf
Raises:
| Type | Description |
|---|---|
VisaIOError
|
If communication fails |
get_playback_status ¶
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 ¶
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 ¶
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 ¶
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 |
get_mask_enable ¶
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 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 |
get_mask_source ¶
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 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 |
get_mask_tolerance_x ¶
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 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 |
get_mask_tolerance_y ¶
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 a pass/fail mask from the current waveform.
Reference: pdf_chapters/3.15.6_MASK_CREate.pdf
Raises:
| Type | Description |
|---|---|
VisaIOError
|
If communication fails |
start_mask_test ¶
Start the pass/fail mask test.
Reference: pdf_chapters/3.15.3_MASK_OPERate.pdf
Raises:
| Type | Description |
|---|---|
VisaIOError
|
If communication fails |
stop_mask_test ¶
Stop the pass/fail mask test.
Reference: pdf_chapters/3.15.3_MASK_OPERate.pdf
Raises:
| Type | Description |
|---|---|
VisaIOError
|
If communication fails |
get_mask_test_status ¶
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 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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 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 ¶
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 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 ¶
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 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 ¶
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 ¶
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 ¶
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 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 ¶
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 ¶
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 ¶
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 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 ¶
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 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 ¶
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 ¶
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 ¶
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 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 ¶
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 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 ¶
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 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 ¶
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 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 ¶
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 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 ¶
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 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 ¶
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 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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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
|
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 |
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)
force_trigger ¶
Generate a trigger signal forcefully (Keysight uses TRIGger:FORCe).
set_vertical_scale ¶
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 (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 (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 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 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 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 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 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 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 timebase scale.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
seconds_per_div
|
float
|
Time per division in seconds |
required |
set_horizontal_offset ¶
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 ¶
Alias for set_horizontal_offset.
get_horizontal_offset ¶
Get the current horizontal offset (time position).
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Time offset in seconds |
move_horizontal ¶
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 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 mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sweep
|
str
|
'AUTO' or 'NORMal' |
required |
get_trigger_status ¶
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 ¶
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 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 ¶
Alias for measure() for compatibility with REPL code.
configure_measurement ¶
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 |
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 |
get_waveform_preamble ¶
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 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 ¶
Capture the current screen image as PNG data.
Returns:
| Name | Type | Description |
|---|---|---|
bytes |
bytes
|
PNG image data |
set_waveform_brightness ¶
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 the waveform persistence time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time_val
|
str
|
Persistence time value |
required |
set_display_type ¶
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 the acquisition type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
acq_type
|
str
|
'NORMal', 'AVERage', 'HRESolution', or 'PEAK' |
required |
set_average_count ¶
Set the number of averages for AVERAGE acquisition mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
count
|
int
|
Number of averages |
required |
get_sample_rate ¶
Query the current sample rate.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Sample rate in Sa/s |
awg_set_output_enable ¶
Enable or disable the AWG output.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enable
|
bool
|
True to enable output, False to disable |
required |
awg_set_function ¶
Set the AWG waveform function type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
function
|
str
|
'SINusoid', 'SQUare', 'RAMP', 'PULSe', 'DC', or 'NOISe' |
required |
awg_set_frequency ¶
Set the AWG output frequency.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
freq
|
float
|
Frequency in Hz |
required |
awg_set_amplitude ¶
Set the AWG output amplitude.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amp
|
float
|
Amplitude in volts (Vpp) |
required |
awg_set_offset ¶
Set the AWG DC offset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
offset
|
float
|
DC offset in volts |
required |
awg_set_square_duty ¶
Set the AWG square wave duty cycle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
duty
|
float
|
Duty cycle percentage |
required |
awg_set_ramp_symmetry ¶
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 ¶
Enable or disable the digital voltmeter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enable
|
bool
|
True to enable, False to disable |
required |
get_dvm_current ¶
Query the current voltage value from DVM.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Current voltage value |
set_dvm_source ¶
Set the DVM source channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
int
|
Channel number (1-4) |
required |
set_dvm_mode ¶
Set the DVM mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
str
|
DVM mode (e.g., 'DC', 'ACRMs', 'DCRMS') |
required |
enable_math_channel ¶
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 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 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 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 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 ¶
Enable or disable mask testing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
enable
|
bool
|
True to enable, False to disable |
required |
get_mask_enable ¶
Query whether mask testing is enabled.
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if enabled, False if disabled |
set_mask_source ¶
Set the source channel for mask testing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel
|
int
|
Channel number (1-4) |
required |
get_mask_source ¶
Query the source channel for mask testing.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Source channel string |
set_mask_tolerance_x ¶
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 the vertical tolerance for the auto mask.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tol
|
float
|
Vertical tolerance in divisions |
required |
get_mask_failed_count ¶
Query the number of waveforms that failed the mask test.
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
Number of failed waveforms |
get_mask_total_count ¶
Query the total number of waveforms tested.
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
Total number of waveforms tested |
get_mask_passed_count ¶
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 ¶
Query all mask test statistics.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Dictionary with 'passed', 'failed', 'total' counts |
get_mask_test_status ¶
Query the mask test status.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
'RUN' if enabled, 'STOP' if disabled |
get_error ¶
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)
change_channel_status ¶
Enable or disable the specified channel.
set_channel_label ¶
Sets the label for a specific channel (Max 30 chars).
set_probe_attenuation ¶
Sets the probe attenuation (Legacy MSO2000 uses PRObe:GAIN).
set_coupling ¶
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_offset ¶
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 ¶
Return the current horizontal delay time in seconds.
set_horizontal_position ¶
Set the horizontal position (percentage 0-100).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
position
|
float
|
Position as percentage (0-100) |
required |
get_horizontal_position ¶
Get the current horizontal position.
Returns:
| Name | Type | Description |
|---|---|---|
float |
Position as percentage (0-100) |
move_horizontal ¶
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 ¶
Sets the acquisition mode. Legacy MSO2000 Supports: SAMPLE, AVERAGE, PEAKDETECT. (HIRES/ENVELOPE might be restricted on some older firmwares, but usually present).
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 the current acquisition state.
Returns:
| Name | Type | Description |
|---|---|---|
int |
1 if running, 0 if stopped |
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 when acquisition stops.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
str
|
'RUNSTop' for continuous or 'SEQuence' for single-shot |
required |
set_vertical_scale ¶
Set the vertical scale (Volts/div) and position (divs).
set_vertical_position ¶
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 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 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 the Edge Trigger parameters.
configure_math ¶
Configures the Math waveform.
measure_math_bnf ¶
Performs a measurement specifically on the Math waveform. Uses Legacy IMMed command (no badges).
configure_measurement ¶
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 a basic measurement function (BNF) on the specified channel. Uses Legacy IMMed command (no badges).
get_waveform_data ¶
Fetch raw unscaled waveform data points from the scope.
get_waveform_scaled ¶
Fetch waveform data and scale it to Time (s) and Voltage (V).
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
(time_values, voltage_values) |
save_waveform_csv ¶
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 ¶
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_delay ¶
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'
|