Exceptions¶
Custom exception classes
Custom exception classes for Siglent oscilloscope control.
SiglentError
¶
Bases: Exception
Base exception class for all Siglent-related errors.
SiglentConnectionError
¶
Bases: SiglentError
Raised when connection to oscilloscope fails or is lost.
SiglentTimeoutError
¶
Bases: SiglentError
Raised when a command times out.
CommandError
¶
Bases: SiglentError
Raised when a SCPI command fails or returns an error.
Optional structured context (all default to None): command is the string
actually sent on the wire, dialect/model identify the instrument, and
instrument_error carries the instrument's own error-queue text where the
failing path already read it.
Source code in scpi_control/exceptions.py
MeasurementUnavailableError
¶
MeasurementUnavailableError(message='', *, command=None, dialect=None, model=None, instrument_error=None)
Bases: CommandError
Raised when the instrument has no value for a measurement right now.
Distinct from a failed read: the wire worked and the instrument answered, it simply has nothing to report for that item yet. A modern Siglent says so with the literal "****" (measured on an SDS824X HD: MEAN answered while PKPK/MAX/MIN returned "****" on the same live channel).
Deliberately a CommandError subclass so callers written before it existed keep catching it, while callers that care can tell "not available yet" apart from "the read is broken" -- the difference between a normal transient and something worth alerting on.
Source code in scpi_control/exceptions.py
InvalidParameterError
¶
InvalidParameterError(message=None, *, parameter=None, value=None, valid_options=None, dialect=None, model=None)
Bases: SiglentError, ValueError
Raised when invalid parameters are provided.
Also a ValueError: validation paths that historically raised bare
ValueError now raise this class, and pre-existing except ValueError
callers must keep catching it.
Source code in scpi_control/exceptions.py
FeatureNotSupportedError
¶
Bases: SiglentError, NotImplementedError
Raised when an operation is not supported by the connected instrument.
Also a NotImplementedError: the PSU capability gates historically raised
bare NotImplementedError, and pre-existing except NotImplementedError
callers must keep catching them. (Same dual-base rationale as
InvalidParameterError, which is also a ValueError.)
FrequencySweepError
¶
Bases: SiglentError
A frequency sweep stopped early; partial holds what it had measured.
Raising bare would throw away every point already captured, which on real hardware can be an hour of bench time. The partial result travels with the exception so a caller can save or inspect it.
Source code in scpi_control/exceptions.py
See Also¶
- Oscilloscope - Main oscilloscope control class for SCPI communication
- Socket Connection - TCP/IP socket communication