diff options
Diffstat (limited to 'qolab/hardware')
-rw-r--r-- | qolab/hardware/scope/rigolds1054z.py | 23 |
1 files changed, 22 insertions, 1 deletions
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 |