Skip to content

Conversation

@diggit
Copy link

@diggit diggit commented Nov 15, 2025

This is a Rigol Oscilloscope driver refactor.
Related issues #943

I need testers for most scope families (see below).

Refactor

  • each family has it's own identifier and can be easily handled individually
  • use STL containers instead of plain C arrays
  • use RAII for safe(r) resource management

Supported devices and new features

  • DS1000: no intended changes, but untested 🙏
  • MSO/DS1000Z: tested ✔️ (DS1054Z with all options, MSO1104Z with all options)
    • LA: ✔️ (MSO1000Z only)
    • implemented memory/samplerate configuration: ✔️
    • improved download speed: ✔️
    • improved trigger poll performance/robustness: ✔️
  • MSO5000: no intended changes, but untested (I can borrow one to validate my changes) 🙏
    • LA: untested
  • DHO800: no intended changes, but untested (I can borrow one to validate my changes) 🙏
  • DHO900: no intended changes, but untested (I can borrow one to validate my changes) 🙏
    • LA: untested
  • DHO1000: no intended changes, but untested 🙏
  • DHO4000: no intended changes, but untested 🙏

Known issues (TBD):

  • Memory depth does not update (in ngscopesclient) when channels are added to the capture.

Fixes

  • Some trigger offset fixes (keep in place and in valid range on samplerate/memory depthy changes)

Triggers

Not yet supported devices

  • MSO/DS2000: not supported yet
  • MSO/DS4000: not supported yet (I have access to this device and can work on the support)
  • MHO900/MHO098: not supported yet, device available via network (Rigol MHO900/MHO98 support #1022)

Differentiate between scope families and
then group their common behavior in switch statements.
This is more flexible approach and allow more fine tuned,
per family behavior than immediately grouping them by protocol.

- use smart pointers where it makes sense
- use vector/array rather than C arrays

DS1000Z
- implemented memory/samplerate configuration
- improved download speed
- improved trigger poll performance/robustness

Other families should have same handling as before.
to make sure all scope families are handled everywhere
When trigger offset was beyond memory range,
at least DS1000Z never received trigger.
This is necessary, because samplerate changes timebase.
While TB changes, Rigol oscilloscopes keep the trigger position constant
relative to the capture mid point.
Because scopehal reference point is at start, the trigger has to be updated
to keep it constant from scopehal's POV.
As interleaving done automatically by scope is not considered
to be an interleaving feature, see ngscopeclient#1014
@preamp-org
Copy link

Known issues (TBD):

  • Memory depth does not update (in ngscopesclient) when channels are added to the capture.

This is happening with the pico-bridge, too, so probably a bug of ngscopeclient itself and not specific to any make or model of 'scopes.

Initial tests with 1 channel and 1 MB chunks worked fine.
Later tests with 2 channels failed, but 500 kB chunk size worked fine,
but failed for 3 or 4 channels. It looks like the chunk size (maxpoints),
also depends on the amount of enabled channels.
There may be still some margin, but it's not worth chaseing it.
Proper resource locking was missing at multiple places.
It may not be 100% complete yet.
- change verbose logs to trace
- add more trace logs
- print detected options
- remove purely development logs
There are DHO4000 series scopes, which support 250 MHZ BW limit.
- all the series/model -> limiters logic is now in `GetChannelBandwidthLimiters`
- `SetChannelBandwidthLimit` uses values from `GetChannelBandwidthLimiters` and uses nearest higher limit
it is more complicated than expected, no obvious rules
- deduce whole trigger state from data preamble rather than status
- resilient against fast triggers skipping transitions
- properly handles busy(wait)/armed(run) states
…ies::MSODS1000Z as there are also MSO scopes
MSODS1000Z was the only exception and it works there.
- recognize MSO1000Z as MSODS1000Z (tested)
- recognize DHO800/DHO900/DHO1000/DHO4000 (untested)
only `double` for now, but templating allows easy addition of more
…nnel configuration

- it may touch channels and it caused bugs when adding LA support
most of necessary includes are already included indirectly
- developed with MSO1000Z series
- MSO5000/DHO900 implemented, but not tested
@diggit
Copy link
Author

diggit commented Dec 1, 2025

@jwise I guess you have access to DHO4000 series scope. Could you give a shot to this PR? If you do please enable trace log for transport and RigolOscilloscope driver.

diggit added 12 commits December 6, 2025 11:20
…hannel

- ATM only affects MSODS1000Z as there are collisions between digital banks and some analog channels
…lDivisor`

because ATM this divisor behavior seems to be specific to MSODS1000Z only
…Depth`

- we have to ensure, the trigger status does not change after we query it
so we can restore correct value in the end
scopehal does not support it now,
so it will not be listed in available trigger inputs
…sableChannel` is called

number of enabled channels may affect current samplerate, especially near the maximum rates
- it is dependent on how many analog channels are enabled
to not report `TRIGGER_MODE_TRIGGERED` when scope state == `TD`,
because then the `ngscopeclient` immediately calls `AcquireData`,
but data are available once the scope reaches `STOP` state, not `TD`.
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.

2 participants