Skip to content

Channel

Channel configuration and control

Channel configuration and control for Siglent oscilloscopes.

Channel

Channel(oscilloscope: Oscilloscope, channel_number: int)

Represents a single oscilloscope channel with configuration controls.

Provides methods to configure channel settings including coupling, voltage scale, offset, probe ratio, and bandwidth limiting.

Initialize channel.

Parameters:

Name Type Description Default
oscilloscope Oscilloscope

Parent Oscilloscope instance

required
channel_number int

Channel number (1-4)

required
Source code in scpi_control/channel.py
def __init__(self, oscilloscope: "Oscilloscope", channel_number: int):
    """Initialize channel.

    Args:
        oscilloscope: Parent Oscilloscope instance
        channel_number: Channel number (1-4)
    """
    self._scope = oscilloscope
    self._channel = channel_number
    self._prefix = f"C{channel_number}"

    if not 1 <= channel_number <= 4:
        raise exceptions.InvalidParameterError(f"Invalid channel number: {channel_number}. Must be 1-4.")

enabled property writable

enabled: bool

Get channel display state.

Returns:

Type Description
bool

True if channel is displayed, False otherwise

coupling property writable

coupling: str

Get channel coupling mode.

Returns:

Type Description
str

Coupling mode: 'DC', 'AC', or 'GND'

voltage_scale property writable

voltage_scale: float

Get vertical scale (volts/division).

Returns:

Type Description
float

Voltage scale in volts/division

voltage_offset property writable

voltage_offset: float

Get vertical offset voltage.

Returns:

Type Description
float

Offset voltage in volts

probe_ratio property writable

probe_ratio: float

Get probe attenuation ratio.

Returns:

Type Description
float

Probe ratio (e.g., 1.0 for 1X, 10.0 for 10X)

bandwidth_limit property writable

bandwidth_limit: str

Get bandwidth limit setting.

Returns:

Type Description
str

Bandwidth limit: 'ON', 'OFF', or frequency limit

unit property writable

unit: str

Get channel vertical unit.

Returns:

Type Description
str

Unit string (typically 'V' for volts)

enable

enable() -> None

Enable channel display.

Source code in scpi_control/channel.py
def enable(self) -> None:
    """Enable channel display."""
    self.enabled = True

disable

disable() -> None

Disable channel display.

Source code in scpi_control/channel.py
def disable(self) -> None:
    """Disable channel display."""
    self.enabled = False

set_scale

set_scale(volts_per_div: float) -> None

Set vertical scale (alias for voltage_scale setter).

Parameters:

Name Type Description Default
volts_per_div float

Voltage scale in volts/division

required
Source code in scpi_control/channel.py
def set_scale(self, volts_per_div: float) -> None:
    """Set vertical scale (alias for voltage_scale setter).

    Args:
        volts_per_div: Voltage scale in volts/division
    """
    self.voltage_scale = volts_per_div

auto_scale

auto_scale() -> None

Perform auto-scale for this channel.

Automatically adjusts voltage scale and offset for optimal viewing.

Source code in scpi_control/channel.py
def auto_scale(self) -> None:
    """Perform auto-scale for this channel.

    Automatically adjusts voltage scale and offset for optimal viewing.
    """
    # Note: Some Siglent models use ASET for global auto-setup
    # For per-channel auto-scale, we might need to use different commands
    # This is a basic implementation that may need adjustment for SD824x
    logger.info(f"Auto-scaling channel {self._channel}")
    self._scope.write("ASET")

get_configuration

get_configuration() -> dict

Get all channel configuration parameters.

Returns:

Type Description
dict

Dictionary with all channel settings

Source code in scpi_control/channel.py
def get_configuration(self) -> dict:
    """Get all channel configuration parameters.

    Returns:
        Dictionary with all channel settings
    """
    return {
        "channel": self._channel,
        "enabled": self.enabled,
        "coupling": self.coupling,
        "voltage_scale": self.voltage_scale,
        "voltage_offset": self.voltage_offset,
        "probe_ratio": self.probe_ratio,
        "bandwidth_limit": self.bandwidth_limit,
        "unit": self.unit,
    }

See Also

  • Oscilloscope - Main oscilloscope control class for SCPI communication
  • Trigger - Trigger configuration and modes