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

Add an additional Rigol quirk to skip INITIATE_CLEAR #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tai
Copy link

@tai tai commented Oct 20, 2022

Hi. This patch updates usbtmc.py quirk handling to make it work better with Rigol DS1000Z-series oscilloscope (and probably also with DS2000-series).

DS1000Z does not handle INITIATE_CLEAR well, and USB response just times out (and hangs) once it receives this message. INITIATE_CLEAR is a required command as per USBTMC spec, but Rigol's implementation is known to be broken in many parts.

There's a workaround to do echo *IDN? > /dev/usbtmc<N> to initialize the device without sending INITIATE_CLEAR, but that's Linux-specific and user has to figure out which /dev/usbtmc* device to use. This patch will make things much easier and portable.

I have tested this patch with rigolcap.py script I pasted to gist:
https://gist.github.com/tai/408053a0955bf1712a5809240aa5544f

Also, just FYI, https://github.com/jtambasco/RigolOscilloscope.git which uses python-usbtmc works with Rigol, but has a following hack to make it work:

os.system('echo *IDN? >> /dev/%s' % dev[3])

With this patch, user of usbtmc.py can now just do this:

tmc = usbtmc.Instrument(0x1ab1, 0x04ce)
tmc.write_raw(b'*IDN?')

@tai tai changed the title Added an additional Rigol quirk to skipINITIATE_CLEAR Added an additional Rigol quirk to skip INITIATE_CLEAR Oct 20, 2022
@tai tai changed the title Added an additional Rigol quirk to skip INITIATE_CLEAR Add an additional Rigol quirk to skip INITIATE_CLEAR Oct 20, 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

1 participant