-
-
Notifications
You must be signed in to change notification settings - Fork 124
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 DS1102Z-E USBTMC read regression #463
Comments
Forgot to mention the original PR author for notification purposes: @hcoffin-vecatom |
Hmm that is unfortunate. Do you happen to know if the usb_recv_ep.wMaxPacketSize long transfer ends in a newline character? If it does, I think the only ways to fix this issue are either to remove the changes from pr #449 or to implement some kind of special logic for devices that don't adhere to the standard (e.g., check for termination characters at the usb read level), which is annoying at best. |
If I request The old read behavior (which relied on multiple requests, checking for the EOM bit to be set in the transaction) works for my Rigol, but if I understand correctly based on reading #449 it seems like at least some Siglent devices fail to set it? Then I don't really know how to fix this, other than to consider introducing a Siglent (no EOM case) and/or Rigol (no short packet as last transaction) quirk. |
As far as I can tell from the examples in the DS1000Z-E-ProgrammingGuide (see screenshot at bottom of this reply) \n (0x0A) is the termination character used by the device. I think it is unlikely to fix things, but if you haven't already, try setting the termination character for pyvisa using
and use I also want to make sure, when using the old read behavior, are you getting the correct data back, or is some part of it being misinterpreted as a header for the Bulk In message? If you are getting the correct data with the old read behavior then your scope is behaving in a quirky way that is different from the quirkiness of either mine or @arr-ee 's instruments. |
Recent changes to the USBTMC read implementation break support for Rigol DS1102Z-E (and possibly other Rigol devices).
PR #449 changed the USBTMC response read implementation to assume a transfer is complete once a short packet (i.e.
<= usb_recv_ep.wMaxPacketSize
) is received based on the following excerpt from the USBTMC spec (§3.3):Unfortunately, it looks like Rigol does not adhere to this part of the spec - no such packets are sent by my Rigol DS1102Z-E. Which also implies pyvisa never manages to complete a transfer if the
transfer
is exactlyusb_recv_ep.wMaxPacketSize
bytes.Trivial reproducer:
Pyivsa should hang, not even responding to
SIGINT
.(As it happens the
*IDN?
response for my device is also exactlyusb_recv_ep.wMaxPacketSize
(64) bytes, but that might not be the case for other models)Note: looks to me @arr-ee might have been experiencing a similar issue on his Siglent device when testing the PR: #449 (comment) - alas, my device is a Rigol and it's on the latest firmware available (00.06.03.SP2).
The text was updated successfully, but these errors were encountered: