# Keysight DSOX1102G Oscilloscope

class pymeasure.instruments.keysight.KeysightDSOX1102G(adapter, name='Keysight DSOX1102G Oscilloscope', **kwargs)

  Bases: `SCPIUnknownMixin`, `Instrument`

  Represents the Keysight DSOX1102G Oscilloscope interface for interacting with the instrument.

  Refer to the Keysight DSOX1102G Oscilloscope Programmer’s Guide for further details about using the lower-level methods to interact directly with the scope.

      scope = KeysightDSOX1102G(resource)
      scope.autoscale()
      ch1_data_array, ch1_preamble = scope.download_data(source="channel1", points=2000)
      # ...
      scope.shutdown()

  Known issues:

  - The digitize command will be completed before the operation is. May lead to VI_ERROR_TMO (timeout) occurring when sending commands immediately after digitize. Current fix: if deemed necessary, add delay between digitize and follow-up command to scope.

  property acquisition_mode

    A string parameter that sets the acquisition mode. Can be “realtime” or “segmented”.

  property acquisition_type

    A string parameter that sets the type of data acquisition. Can be “normal”, “average”, “hresolution”, or “peak”.

  autoscale()

    Autoscale displayed channels.

  clear_status()

    Clear device status.

  default_setup()

    Default setup, some user settings (like preferences) remain unchanged.

  digitize(source: str)

    Acquire waveforms according to the settings of the :ACQuire commands. Ensure a delay between the digitize operation and further commands, as timeout may be reached before digitize has completed. :param source: “channel1”, “channel2”, “function”, “math”, “fft”, “abus”, or “ext”.

  download_data(source, points=62500)

    Get data from specified source of oscilloscope. Returned objects are a np.ndarray of data values (no temporal axis) and a dict of the waveform preamble, which can be used to build the corresponding time values for all data points.

    Multimeter will be stopped for proper acquisition.

    Parameters:

      - source – measurement source, can be “channel1”, “channel2”, “function”, “fft”, “wmemory1”, “wmemory2”, or “ext”.

      - points – integer number of points to acquire. Note that oscilloscope may return fewer points than specified, this is not an issue of this library. Can be 100, 250, 500, 1000, 2000, 5000, 10000, 20000, 50000, or 62500.

    Return data_ndarray, waveform_preamble_dict:

      see waveform_preamble property for dict format.

  download_image(format_='png', color_palette='color')

    Get image of oscilloscope screen in bytearray of specified file format.

    Parameters:

      - format – “bmp”, “bmp8bit”, or “png”

      - color_palette – “color” or “grayscale”

  factory_reset()

    Factory default setup, no user settings remain unchanged.

  run()

    Starts repetitive acquisitions.

    This is the same as pressing the Run key on the front panel.

  single()

    Causes the instrument to acquire a single trigger of data. This is the same as pressing the Single key on the front panel.

  stop()

    Stops the acquisition. This is the same as pressing the Stop key on the front panel.

  property system_setup

    A string parameter that sets up the oscilloscope. Must be in IEEE 488.2 format. It is recommended to only set a string previously obtained from this command.

  property timebase

    Read timebase setup as a dict containing the following keys: - “REF”: position on screen of timebase reference (str) - “MAIN:RANG”: full-scale timebase range (float) - “POS”: interval between trigger and reference point (float) - “MODE”: mode (str)

  property timebase_mode

    A string parameter that sets the current time base. Can be “main”, “window”, “xy”, or “roll”.

  property timebase_offset

    A float parameter that sets the time interval in seconds between the trigger event and the reference position (at center of screen by default).

  property timebase_range

    A float parameter that sets the full-scale horizontal time in seconds for the main window.

  property timebase_scale

    A float parameter that sets the horizontal scale (units per division) in seconds for the main window.

  timebase_setup(mode=None, offset=None, horizontal_range=None, scale=None)

    Set up timebase. Unspecified parameters are not modified. Modifying a single parameter might impact other parameters. Refer to oscilloscope documentation and make multiple consecutive calls to channel_setup if needed.

    Parameters:

      - mode – Timebase mode, can be “main”, “window”, “xy”, or “roll”.

      - offset – Offset in seconds between trigger and center of screen.

      - horizontal_range – Full-scale range in seconds.

      - scale – Units-per-division in seconds.

  property waveform_data

    Get the binary block of sampled data points transmitted using the IEEE 488.2 arbitrary block data format.

  property waveform_format

    A string parameter that controls how the data is formatted when sent from the oscilloscope. Can be “ascii”, “word” or “byte”. Words are transmitted in big endian by default.

  property waveform_points

    An integer parameter that sets the number of waveform points to be transferred with the waveform_data method. Can be any of the following values: 100, 250, 500, 1000, 2 000, 5 000, 10 000, 20 000, 50 000, 62 500.

    Note that the oscilloscope may provide less than the specified nb of points.

  property waveform_points_mode

    A string parameter that sets the data record to be transferred with the waveform_data method. Can be “normal”, “maximum”, or “raw”.

  property waveform_preamble

    Get preamble information for the selected waveform source as a dict with the following keys: - “format”: byte, word, or ascii (str) - “type”: normal, peak detect, or average (str) - “points”: nb of data points transferred (int) - “count”: always 1 (int) - “xincrement”: time difference between data points (float) - “xorigin”: first data point in memory (float) - “xreference”: data point associated with xorigin (int) - “yincrement”: voltage difference between data points (float) - “yorigin”: voltage at center of screen (float) - “yreference”: data point associated with yorigin (int)

  property waveform_source

    A string parameter that selects the analog channel, function, or reference waveform to be used as the source for the waveform methods. Can be “channel1”, “channel2”, “function”, “fft”, “wmemory1”, “wmemory2”, or “ext”.