Skip to content

Add OWON SDS1104 oscilloscope driver#472

Open
kerby2000 wants to merge 2 commits intoinstrumentkit:mainfrom
kerby2000:add-owon-sds1104
Open

Add OWON SDS1104 oscilloscope driver#472
kerby2000 wants to merge 2 commits intoinstrumentkit:mainfrom
kerby2000:add-owon-sds1104

Conversation

@kerby2000
Copy link

Summary

This PR adds support for the OWON SDS1104 oscilloscope family over raw USB.

The driver is based on stable behavior verified against a compatible
HANMATEK DOS1104 unit on the same hardware family.

Included changes

  • add instruments.owon.OWONSDS1104
  • add package exports and API reference docs for instruments.owon
  • add a minimal example script
  • add raw USB binary helpers needed for the SDS1104 USB transport
  • add transcript-based unit tests for text, binary, waveform, BMP,
    deep-memory, saved-waveform, and trigger paths

Public API scope

The initial public API includes:

  • run/stop control
  • channel display, coupling, probe attenuation, scale, offset, position, invert
  • acquisition mode, averages, memory depth, timebase scale, horizontal offset
  • trigger status, trigger mode, and edge-trigger source/coupling/slope/level
  • autoscale action
  • scalar measurement helpers
  • measurement blob reads
  • screen waveform retrieval and waveform metadata
  • BMP screen capture
  • deep-memory capture
  • saved-waveform index and raw data access

Notes

The SDS1104 family uses a prompt-style raw USB text path and binary packet
transfers rather than newline-terminated USB text replies, so the driver uses
small USB communicator extensions for packet and binary reads.

Memory-depth support is intentionally conservative. Broader family documents
list higher depths, but compatibility hardware used for validation appears
capped at 20K record length.

A small deterministic timeout fix in the ThorLabs APT abstract base is also
included because broader validation exposed a zero-timeout edge case in the
existing suite.

Testing

I ran:

python -m pytest tests/test_owon/test_sds1104.py tests/test_comm/test_usb_communicator.py tests/test_tektronix/test_tektronix_tds224.py tests/test_rigol/test_rigolds1000.py tests/test_package.py -q
python -m pytest -q
python -m pylint src/instruments/owon/sds1104.py src/instruments/abstract_instruments/comm/usb_communicator.py
python -m black --check src/instruments/owon/sds1104.py tests/test_owon/test_sds1104.py

kerby2000 and others added 2 commits March 8, 2026 21:55
Add support for the OWON SDS1104 oscilloscope family over raw USB.

This adds a conservative upstream-facing driver with:
- run/stop control
- channel display, coupling, probe, scale, offset, position, and invert
- acquisition mode, averages, memory depth, timebase scale, and horizontal offset
- trigger status, trigger mode, edge-trigger source/coupling/slope/level
- scalar measurements and measurement blob queries
- screen waveform retrieval and waveform metadata
- BMP screen capture
- deep-memory capture
- saved-waveform list and raw data access

Also add the raw USB binary helpers needed by the driver, transcript-style
unit tests, API docs, and a minimal example script.

The initial driver keeps memory-depth support conservative for compatibility
hardware that appears capped at 20K record length despite broader family docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant