-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
Support partial usbtmc reads and request the size
amount of bytes from the device
#470
Support partial usbtmc reads and request the size
amount of bytes from the device
#470
Conversation
…t IEEE 488.2 arbitrary block reads fixes the requested data to be send in the header instead of recv_chunk.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #470 +/- ##
==========================================
- Coverage 24.46% 24.42% -0.04%
==========================================
Files 23 23
Lines 3487 3492 +5
Branches 398 400 +2
==========================================
Hits 853 853
- Misses 2629 2634 +5
Partials 5 5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Speed performance for a command that send a large amount of data back:
|
I think, at least, following issues are impacted and should benefit from this PR.
|
Thanks @Jimmyvandenbergh and sorry for the delay. This is a clear improvement and I will merge the companion PR to PyVISA when I manage to test it since I am a bit more worried about side effects of those changes |
another update for reading the data back from the device. this enhances the PR #465
changes explained below:
req = BulkInMessage.build_array(self._btag, size, None)
we want to request the amount of bytes from the device which user specifies. therefore the header may specify more bytes then in a single transactionwMaxPacketSize
can be transmitted. the device may response with less bytes.resp = raw_read(self.usb_recv_ep.wMaxPacketSize)
you may requestwMaxPacketSize
but the device may send less bytes than requestedfix the indentation of the
received_message.extend(received_transfer[: response.transfer_size])
this should always remove the alignment bytes instead of only onEOM
updated the code to request
x
amount ofwMaxPacketSize
to be read instead ofwMaxPacketSize
this to improve readout speeds.Closes # (insert issue number if relevant)
Executed
black . && isort -c . && flake8
with no errorsThe change is fully covered by automated unit tests
Documented in docs/ as appropriate
Added an entry to the CHANGES file