aboutsummaryrefslogtreecommitdiff
path: root/qolab/hardware/scope/sds1104x.py
diff options
context:
space:
mode:
authorEugeniy E. Mikhailov <evgmik@gmail.com>2021-12-30 17:03:20 -0500
committerEugeniy E. Mikhailov <evgmik@gmail.com>2021-12-30 17:03:20 -0500
commitb9714fdd3b6cc044a84493441dfe2ff7723c66f0 (patch)
tree1559774c31fa198ea01343dfff559d94c0d4d76c /qolab/hardware/scope/sds1104x.py
parentfe356868787a7539c8bcf2d8a39b437cd4fd9a74 (diff)
downloadqolab-b9714fdd3b6cc044a84493441dfe2ff7723c66f0.tar.gz
qolab-b9714fdd3b6cc044a84493441dfe2ff7723c66f0.zip
added scope ability to check LED status, and switch Roll and Stop/Run
Diffstat (limited to 'qolab/hardware/scope/sds1104x.py')
-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?'