From 146852c85b46b3dc9b94ea0fb4f8b5b02e1c953d Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Fri, 19 Jul 2024 00:14:56 -0400 Subject: better doc string --- qolab/hardware/scope/rigolds1054z.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'qolab/hardware/scope/rigolds1054z.py') diff --git a/qolab/hardware/scope/rigolds1054z.py b/qolab/hardware/scope/rigolds1054z.py index a97db67..8a7d9a5 100644 --- a/qolab/hardware/scope/rigolds1054z.py +++ b/qolab/hardware/scope/rigolds1054z.py @@ -171,7 +171,7 @@ class RigolDS1054z(ScopeSCPI): chunk_size = 70_000 # unfortunately large chunk size prone to read errors errCnt = 0 strt = 1 - stp = min(maxreadable, Npnts) + stp = min(chunk_size, Npnts) errorFreeChunkSize = [] errorProneChunkSize = [] while strt <= Npnts: @@ -182,6 +182,17 @@ class RigolDS1054z(ScopeSCPI): self.write(f":WAVeform:STOP {stp}") qstr = ":WAVeform:DATA?" try: + """ + All this caraziness with tuning chunk_size + is because Rigol usbtmc connection is bugy. + It present itself as high speed device over USB, + but set incompatible packet size of 64 + while the USB standard dictates 512. + In linux dmesg complains: + kernel: ... bulk endpoint 0x3 has invalid maxpacket 64 + + Seel + wfRawChunk = self.query_binary_values( qstr, datatype="b", @@ -192,6 +203,16 @@ class RigolDS1054z(ScopeSCPI): if len(wfRawChunk) == 0: continue # we need to repeat chunk read wfRaw[strt - 1 : stp] = wfRawChunk + """ + All this craziness with tuning chunk_size + and catching VisaIOError + is because Rigol usbtmc connection is bugy. + It present itself as high speed device over USB, + but set incompatible packet size of 64 + while the USB standard dictates 512. + In linux dmesg complains: + 'bulk endpoint 0x3 has invalid maxpacket 64' + """ errorFreeChunkSize.append(chunk_size) chunk_size = min(maxreadable, int(chunk_size * 1.1)) strt += chunk_size -- cgit v1.2.3