Keysight3000TX#
- class Keysight3000TX(
- visa_resource: str | VisaConfig,
Bases:
ScopeDriverBaseSCPI driver for Keysight InfiniiVision 3000T X-Series oscilloscopes (2- and 4-channel DSO/MSO).
Methods
Drain
:SYSTem:ERRor?until it reports0and raise listing every non-zero entry.Close the underlying transport.
:DIGitizethe cached trigger source, then*OPC?under a scoped VISA timeout.Fetch the waveform from
channeloverWORD(unsigned 16-bit, LSB-first), requesting 1000 points.Force a trigger event immediately, regardless of the configured conditions.
Read back the current acquisition mode.
:OPERegister:CONDition?bit 3 (0x08) — set = RUNNING, clear = STOPPED.Read back the waveforms-to-average count.
Read back input coupling on
channel.Read back the timebase (seconds/div).
Read back
channel's probe attenuation ratio.Read back the current sample rate (samples per second).
:OPERegister:CONDition?bits: 0x20 = ARMED, 0x08 = AUTO (running); a stopped scope reports TRIGGERED.Read back
channel's vertical offset (volts).Read back
channel's vertical scale (V/div).:RECall:SETupfrom scope memory, or send local bytes via:SYSTem:SETup.Install then query a built-in measurement on
channel.Open the underlying transport.
Start continuous (free-running) acquisition.
:SAVE:IMAGe(as PNG) to the scope, or:DISPlay:DATA? PNG,COLorand write locally.:SAVE:SETup "<name>"to the scope's file system (.scp), or:SYSTem:SETup?to the host.Set the acquisition mode.
Set the number of waveforms to average.
Turn
channelon or off.Set AC/DC input coupling on
channel.Set the timebase to
seconds_per_div.Set
channel's probe attenuation ratio (e.g. 1, 10, 100, 1000).:TRIGger:EDGE:LEVel; a<source>is only honored for the active trigger source, so the cached one is used.Set the trigger sweep mode (AUTO / NORMAL).
Set the trigger edge slope (RISING / FALLING / EITHER).
Set the trigger source to analog
channel.Set the trigger type (EDGE, PULSE, …).
Set
channel's vertical offset tooffset(volts).Set
channel's vertical scale tovolts_per_div(V/div).Ensure a measurement slot exists for
measurement_type/channelbefore the scope triggers.:SINGle.Stop acquisition.
- open() None[source]#
Open the underlying transport. Idempotent.
Concrete drivers also perform any one-shot instrument setup here (e.g.
*CLS, remote-mode handshake).
- check_errors() None[source]#
Drain
:SYSTem:ERRor?until it reports0and raise listing every non-zero entry.
- set_vertical_scale( ) None[source]#
Set
channel’s vertical scale tovolts_per_div(V/div).Drivers may snap to the nearest hardware-supported step. Callers that need the actual applied value should
get_vertical_scale()afterward.
- set_vertical_offset(offset: float, channel: int) None[source]#
Set
channel’s vertical offset tooffset(volts).
- set_probe_attenuation( ) None[source]#
Set
channel’s probe attenuation ratio (e.g. 1, 10, 100, 1000).
- set_channel_display(enabled: bool, channel: int) None[source]#
Turn
channelon or off. Waveform fetches and measurements need the channel displayed.
- set_horizontal_scale(seconds_per_div: float) None[source]#
Set the timebase to
seconds_per_div. Applies globally to all channels.
- get_sample_rate() float[source]#
Read back the current sample rate (samples per second).
This is the effective hardware rate the scope is acquiring at; it depends on the timebase, memory depth, and interpolation settings.
- set_acquisition_mode(
- mode: AcquisitionMode,
Set the acquisition mode.
Drivers should raise
NotImplementedErrorforAcquisitionModevalues their scope doesn’t support (e.g. Keysight 1200X has no ENVELOPE mode).
- get_acquisition_mode() AcquisitionMode[source]#
Read back the current acquisition mode.
- set_average_count(count: int) None[source]#
Set the number of waveforms to average. Only takes effect in
AcquisitionMode.AVERAGE.
- stop() None[source]#
Stop acquisition. Leaves the captured data intact for
fetch_waveform/measure.
- digitize(timeout: float) None[source]#
:DIGitizethe cached trigger source, then*OPC?under a scoped VISA timeout.On any failure
clear()aborts the pending op so the session stays usable; only a VISA timeout is reported asTimeoutError, other errors propagate as-is.
- get_acquisition_state() AcquisitionState[source]#
:OPERegister:CONDition?bit 3 (0x08) — set = RUNNING, clear = STOPPED.
- fetch_waveform(
- channel: int,
Fetch the waveform from
channeloverWORD(unsigned 16-bit, LSB-first), requesting 1000 points.The scope returns as close to 1000 points as its settings allow (it may return fewer, e.g. 992); the transfer is checked against the preamble’s point count.
- measure(
- measurement_type: ScopeMeasurementType,
- channel: int,
Install then query a built-in measurement on
channel.The install form runs first as a guard — bad command syntax surfaces via
check_errors()before we’d block on the query. The vendor’s invalid-measurement sentinel maps toNaN.
- set_trigger_source(channel: int) None[source]#
Set the trigger source to analog
channel.Drivers typically cache this value because the trigger-level SCPI on some scopes requires the source channel in the same command.
- set_trigger_type(
- trigger_type: TriggerType,
Set the trigger type (EDGE, PULSE, …).
- set_trigger_level(level: float) None[source]#
:TRIGger:EDGE:LEVel; a<source>is only honored for the active trigger source, so the cached one is used.
- set_trigger_slope(
- slope: TriggerSlope,
Set the trigger edge slope (RISING / FALLING / EITHER).
- set_trigger_mode(
- mode: TriggerMode,
Set the trigger sweep mode (AUTO / NORMAL).
AUTO forces an acquisition if no trigger fires within the timeout; NORMAL waits indefinitely for a real trigger.
- force_trigger() None[source]#
Force a trigger event immediately, regardless of the configured conditions.
- get_trigger_status() TriggerStatus[source]#
:OPERegister:CONDition?bits: 0x20 = ARMED, 0x08 = AUTO (running); a stopped scope reports TRIGGERED.
- save_screenshot( ) bytes[source]#
:SAVE:IMAGe(as PNG) to the scope, or:DISPlay:DATA? PNG,COLorand write locally.
- save_settings( ) bytes[source]#
:SAVE:SETup "<name>"to the scope’s file system (.scp), or:SYSTem:SETup?to the host.
- load_settings( ) None[source]#
:RECall:SETupfrom scope memory, or send local bytes via:SYSTem:SETup.The recalled setup may select a different trigger source, so the cached one is dropped; call
set_trigger_sourceagain beforeset_trigger_level.
- setup_measurement(
- measurement_type: ScopeMeasurementType,
- channel: int,
Ensure a measurement slot exists for
measurement_type/channelbefore the scope triggers.Required for instruments (e.g. Tektronix) that compute measurements during acquisition — the slot must be present at trigger time or the first
measure()returns stale/invalid data. Default is a no-op for instruments (e.g. Keysight 1200X) that compute on demand.