-
Notifications
You must be signed in to change notification settings - Fork 126
WIP: Rigol oscilloscope refactor #1017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
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
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
…o `std::optional`
…series because at least `ngscopeclient` starts the download when the scope enters triggered state, but the data are not ready yet. So we interpret `TD` as `TRIGGER_MODE_RUN` and flip to triggered/stop later
…mble` just in case so we don't read some garbage
|
DHO800 was mostly working. Some quirks were added. |
|
MSO5072 with upgrade for 4 channels and 200MHz here. |
|
hi @Wiljan1, yeah according to the web, MSO5072 has only 2 analog channels, so the behavior is as expected. I am surprised the model number did not change with mentioned upgrade (upgrading DS1054Z to 100 MHz BW changes the model numbert to DS1104Z). I am not aware of any way how to inject some per instance overrides, so I will look into some alternative way, how to detect available channels. Thanks for the feedback! Though this driver changed a lot since 0.1, this logic did not. |
|
Hi @diggit ,
I think the :SYSTem:OPTion:STATus? can be used to check number of Analog channels, BW :
Let me know if you want me to test something? Thank you |
|
@x44203 mentioned, that |
|
I have to read more carefully next time. EDIT: Ok, Alternative approach could be to request |
|
@diggit It seems to return 1 for some options, but they do not reflect the full capabilities of the scope (mine definitely has 4 channels) Edit:
Agreed, when I wrote that code I must have assumed that MSO5072 shows up as MSO5074. Maybe a check similar to the code for memory depth checking would be better. |
|
@diggit @x44203 could be that an original 4ch scope does not accept the cmd. Channel Number Upgrade Option I'm not next to the scope until Tuesday, then I can try the :SYSTem:OPTion:STATus? 4CH on the MSO5072 |
…option detection MSO5xx2 scopes are scopes with only 2 channels and other 2 channels are SW option. Usually `:SYST:OPT:STAT? 4CH` query should be enough, but there are modifier FWs which report `0` (not present), but the option is active. This is and attempt to detect it using `:CHAN3:VERN ON`, which is expected to trigger error if option is missing. We intentionally do not use any CHAN3 query, as those time out.
|
@diggit thx I need to know how add the commit to the build on windows in the MSYS2 so I can test it, right now I can compile the main git source. |
|
@Wiljan1 if you have the environment to build scopehal-apps, you are 99% done.
|
|
@diggit when I add your instructions above and do a build it unfortunate fails: `[201/542] Building CXX object lib/scopehal/CMakeFiles/scopehal.dir/RigolOscilloscope.cpp.obj In file included from C:/msys64/home/Jan Jakobsen/scopehal-apps/lib/scopehal/RigolOscilloscope.cpp:31: and a lot more warnings and finally cc1plus.exe: all warnings being treated as errors |
|
Eh, Windows environment never disappoints. Please pull changes and retry. |
|
Still having trouble with the git pull / compile, now I'm next to my scope and did connect by a terminal program *IDN? :SYSTem:RAMount? Syntax :SYSTem:RAMount? The :SYSTem:OPTion:STATus? did noit respond for the 4CH |
|
Ok, this looks straightforward. I will implement channel detestion this way. |
|
It's the same error when build since the cmd you suggest I'm new to use git so have to learn :-) |
|
My bad, pull request are not branches, so local branch can't track it. instead of pulling changes ( I've also simplified analog channel detection to use |
|
@diggit when running the ./ngscopeclient.exe and adding the scope I only see 2 channels and 1 is disabled |


This is a Rigol Oscilloscope driver refactor.
Related issues #943
I need testers for most scope families (see below).
Refactor
Supported devices and new features
Known issues (TBD):
non device specific
Triggers
Not yet supported devices