diff options
Diffstat (limited to 'qolab/hardware/scope/sds1104x.py')
-rw-r--r-- | qolab/hardware/scope/sds1104x.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/qolab/hardware/scope/sds1104x.py b/qolab/hardware/scope/sds1104x.py index 540e800..da7fd65 100644 --- a/qolab/hardware/scope/sds1104x.py +++ b/qolab/hardware/scope/sds1104x.py @@ -187,13 +187,29 @@ class SDS1104X(ScopeSCPI): t.config['tags']['Npnts'] = availableNpnts t.config['tags']['Sparsing'] = sparsing return(t) + + def getTriggerMode(self): + # we expect NORM, AUTO, SINGLE, STOP + res = scope.query('TRIG_MODE?') + # res is in the form 'TRMD AUTO' + return res[5:] + + def setTriggerMode(self, val): + # we expect NORM, AUTO, SINGLE, STOP + res = scope.write(f'TRIG_MODE {val}') def getTrace(self, chNum, availableNpnts=None, maxRequiredPoints=None, decimate=True): + old_trg_mode = self.getTriggerMode() + self.setTriggerMode('STOP'); # to get synchronous channels wfVoltage, availableNpnts = self.getWaveform( chNum, availableNpnts=availableNpnts, maxRequiredPoints=maxRequiredPoints, decimate=decimate) t = self.getTimeTrace(availableNpnts=availableNpnts, maxRequiredPoints=maxRequiredPoints) tr = TraceXY( f'Ch{chNum}' ) tr.x = t tr.y = wfVoltage + # restore scope to the before acquisition mode + if old_trg_mode != "STOP": + # short speed up here with this check + self.setTriggerMode(old_trg_mode) return( tr ) |