aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qolab/hardware/scope/sds1104x.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/qolab/hardware/scope/sds1104x.py b/qolab/hardware/scope/sds1104x.py
index 6f12042..a812f5f 100644
--- a/qolab/hardware/scope/sds1104x.py
+++ b/qolab/hardware/scope/sds1104x.py
@@ -75,9 +75,14 @@ class SDS1104X(ScopeSCPI):
"""
(sparsing, Npnts, availableNpnts, maxRequiredPoints) = self.calcSparsingAndNumPoints(availableNpnts, maxRequiredPoints)
+ if decimate:
+ Npnts = availableNpnts # get all of them and decimate later
if (sparsing == 1 and Npnts == availableNpnts) or decimate:
- # we are getting all of it
- cstr = f'WAVEFORM_SETUP NP,0,FP,0,SP,{sparsing}'
+ # We are getting all points of the trace
+ # Apparently sparsing has no effect with this command
+ # and effectively uses SP=1 for any sparsing
+ # but I want to make sure and force it
+ cstr = f'WAVEFORM_SETUP NP,0,FP,0,SP,1'
# technically when we know Npnts and sparsing
# we can use command from the follow up 'else' clause
else:
@@ -109,7 +114,12 @@ class SDS1104X(ScopeSCPI):
qstr = f'C{chNum}:WAVEFORM? DAT2'
# expected full reply: 'C1:WF DAT2,#9000000140.........'
try:
- wfRaw=self.query_binary_values(qstr, datatype='b', header_fmt='ieee', container=np.array, chunk_size=(Npnts+100))
+ wfRaw=self.query_binary_values(qstr, datatype='b', header_fmt='ieee', container=np.array, chunk_size=(Npnts+100))
+ # somehow on windows there is a lingering empty string
+ # which we need to flush out
+ r=self.read()
+ if r != '':
+ print(f'UPS. We expected an empty string but got {r=}')
trRaw.values = wfRaw.reshape(wfRaw.size,1)
if decimate and sparsing != 1:
numtaps = 3; # not sure it is the best case