aboutsummaryrefslogtreecommitdiff
path: root/qolab/hardware/scope/sds800xhd.py
diff options
context:
space:
mode:
Diffstat (limited to 'qolab/hardware/scope/sds800xhd.py')
-rw-r--r--qolab/hardware/scope/sds800xhd.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/qolab/hardware/scope/sds800xhd.py b/qolab/hardware/scope/sds800xhd.py
index 9fd67df..eee6bc9 100644
--- a/qolab/hardware/scope/sds800xhd.py
+++ b/qolab/hardware/scope/sds800xhd.py
@@ -258,6 +258,57 @@ class SDS800XHD(SDS1104X):
cstr = f":ACQuire:SRATe {val}"
self.write(cstr)
+ @BasicInstrument.tsdb_append
+ def getMemoryDepth(self):
+ rstr = self.query(":ACQuire:MDEPth?")
+ if rstr[-1] == "G":
+ return int(rstr[:-1]) * 1_000_000_000
+ if rstr[-1] == "M":
+ return int(rstr[:-1]) * 1_000_000
+ if rstr[-1] == "k":
+ return int(rstr[:-1]) * 1_000
+ return int(rstr)
+
+ @BasicInstrument.tsdb_append
+ def setMemoryDepth(self, val):
+ """
+ Set scope memory depth. Only predefined values are possible.
+
+ Note: Memory management should be set to fixed
+ memory depth otherwise this command has no effect,
+ while reporting success.
+ """
+ self.write(
+ ":ACQuire:MMANagement FMDepth"
+ ) # switch to fixed memory depth setting
+ # Note: 1k setting is not possible, but manual claims otherwise
+ # if val <= 1e3:
+ # depth = "1k"
+ if val <= 10e3:
+ depth = "10k"
+ elif val <= 100e3:
+ depth = "100k"
+ elif val <= 1e6:
+ depth = "1M"
+ elif val <= 10e6:
+ depth = "10M"
+ else:
+ logger.info(
+ "Memory depth higher than 10M are possible for 2 or 1 channels acquisition modes."
+ )
+ logger.info("If you know what you doing set it manually.")
+ logger.info("For now are setting to 10M memory depth.")
+ depth = "10M"
+ # Note: the manual states that 100M possible
+ # but I do not see it in the front panel
+ # here are the values for achievable settings
+ # depth = "25M" # possible for 2 channels
+ # depth = "50M" # possible for 1 channels
+
+ cstr = f":ACQuire:MDEPth {depth}"
+ self.write(cstr)
+
+
if __name__ == "__main__":
import pyvisa