aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qolab/hardware/scope/sds1104x.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/qolab/hardware/scope/sds1104x.py b/qolab/hardware/scope/sds1104x.py
index 657f599..4aa5c5e 100644
--- a/qolab/hardware/scope/sds1104x.py
+++ b/qolab/hardware/scope/sds1104x.py
@@ -142,6 +142,43 @@ class SDS1104X(ScopeSCPI):
prefix, numberString, unit = response2numStr(rstr, firstSeparator=' ', unit='V')
return(float(numberString))
+ def getLED(self):
+ """ Returns binary mask of available LEDs """
+ qstr = 'LED?'
+ rstr = self.query(qstr)
+ prefix, numberString, unit = response2numStr(rstr, firstSeparator=' ', unit='')
+ return(int(numberString,16)) # convert from hex string to integer
+
+ def toggleRun(self):
+ # SY_FP is undocumented, reverse engineered from the web interface
+ self.write('SY_FP 12,1')
+
+ @BasicInstrument.tsdb_append
+ def getRun(self):
+ ledStatus = self.getLED()
+ return bool(ledStatus & (1 << 17))
+
+ @BasicInstrument.tsdb_append
+ def setRun(self, val):
+ state = self.getRun()
+ if state != val:
+ self.toggleRun()
+
+ @BasicInstrument.tsdb_append
+ def getRoll(self):
+ ledStatus = self.getLED()
+ return bool(ledStatus & (1 << 10))
+
+ def toggleRoll(self):
+ # SY_FP is undocumented, reverse engineered from the web interface
+ self.write('SY_FP 49,1')
+
+ @BasicInstrument.tsdb_append
+ def setRoll(self, val):
+ rollState = self.getRoll()
+ if rollState != val:
+ self.toggleRoll()
+
@BasicInstrument.tsdb_append
def getTimePerDiv(self):
qstr = f'TDIV?'