Skip to content
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

Rigol MSO5000 Fixes #696

Merged
merged 4 commits into from
Sep 26, 2022
Merged

Conversation

ehntoo
Copy link
Contributor

@ehntoo ehntoo commented Sep 26, 2022

This PR fixes a crash with the Rigol MSO5000 where if waveform data was requested too quickly after a trigger event, the scope would send a response header but no waveform data to follow it. Additionally, there are some quality-of-life improvements/bugfixes.

If we ask for waveform data too quickly after a trigger event, my
MSO5074 won't respond with any data. Experimentally, I've found two ways
to avoid this:
1. Stop using `SO_RCVTIMEO` on the MSO5000's LAN socket and re-send our
   :WAV:DATA? request on reception of no response following the header
2. Send a *WAI request prior to sending :WAV:DATA?. The MSO5000
   programming guide seems to suggest *WAI does nothing at all, but I
   have not been able to reproduce any waveform reception failures after
   adding it to the AcquireData sequence.

This commit adopts approach 2, as it avoids polluting the code with any
assumptions or special handling for certain SCPI transport methods.

Thanks to @bvernoux for his nice standalone "rigol_mso5000" utility
which made verifying this change exceptionally simple.
The current rigol constructor for MSO5000 series scopes runs through an
iterative process to determine what the actual bandwidth of a connected
device is by setting progressive channel bandwidth limits and seeing if
they take effect.

We were not restoring the previously-set bandwidth limit after this
process, which might cause some user confusion.
The MSO5000 will annoyingly only update its programmed sample depth
while in normal or auto run modes. To accommodate this limitation, we
temporarily go into auto mode and run the scope while setting a new
sample depth, then restore the scope state as best we can once the new
settings have been programmed.
@azonenberg azonenberg merged commit 7553161 into ngscopeclient:master Sep 26, 2022
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.

None yet

2 participants