diff options
Diffstat (limited to 'qolab/hardware')
-rw-r--r-- | qolab/hardware/scope/rigolds1054z.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/qolab/hardware/scope/rigolds1054z.py b/qolab/hardware/scope/rigolds1054z.py index bf5a6a5..d43752a 100644 --- a/qolab/hardware/scope/rigolds1054z.py +++ b/qolab/hardware/scope/rigolds1054z.py @@ -99,6 +99,13 @@ class RigolDS1054z(ScopeSCPI): return True return False + def setRun(self, val): + """Either enable run or stop.""" + + if val: + self.run() + self.stop() + @BasicInstrument.tsdb_append def getTimeBaseMode(self): """Get he mode of the horizontal timebase. @@ -414,8 +421,9 @@ class RigolDS1054z(ScopeSCPI): def getTrace( self, chNum, availableNpnts=None, maxRequiredPoints=None, decimate=True ): - old_trg_status = self.getTriggerStatus() - self.stop() + old_run_status = self.getRun() + if old_run_status: # avoid unnecessary status change + self.setRun(False) # stop if currently running # to get synchronous channels wfVoltage, rawChanCfg = self.getWaveform( chNum, @@ -428,8 +436,8 @@ class RigolDS1054z(ScopeSCPI): tr.x = t tr.y = wfVoltage # restore scope to the before acquisition mode - if old_trg_status != "STOP": - self.run() + if old_run_status: # avoid unnecessary status change + self.setRun(old_run_status) # start running if it was old run state return tr |