From 3caa835b22b6ba07481b272a32cab8daeb6b3f02 Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Mon, 17 Jun 2024 16:50:35 -0400 Subject: added modifications to include Siglent SDS2304X model --- qolab/hardware/scope/__init__.py | 1 + qolab/hardware/scope/sds2304x.py | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 qolab/hardware/scope/sds2304x.py diff --git a/qolab/hardware/scope/__init__.py b/qolab/hardware/scope/__init__.py index 3bca8f0..b4bdd0e 100644 --- a/qolab/hardware/scope/__init__.py +++ b/qolab/hardware/scope/__init__.py @@ -81,4 +81,5 @@ class ScopeSCPI(SCPIinstr, Scope): self.config['DeviceId'] = str.strip(self.idn) from .sds1104x import SDS1104X +from .sds2304x import SDS2304X diff --git a/qolab/hardware/scope/sds2304x.py b/qolab/hardware/scope/sds2304x.py new file mode 100644 index 0000000..fc9b129 --- /dev/null +++ b/qolab/hardware/scope/sds2304x.py @@ -0,0 +1,33 @@ +""" +by Rob Behary and Eugeniy Mikhailov 2024/06/17 +""" + +from qolab.hardware.scope import SDS1104X +from qolab.hardware.basic import BasicInstrument + +import re + +class SDS2304X(SDS1104X): + """ Siglent SDS2354x scope """ + vertDivOnScreen = 8 # unlike SDS1104X, number of divisions matches what is seen on the screen + horizDivOnScreen = 10 + def __init__(self, resource, *args, **kwds): + super().__init__(resource, *args, **kwds) + self.config['Device model'] = 'SDS2304X' + self.resource.read_termination='\n' + self.numberOfChannels = 4 + self.maxRequiredPoints = 1000; # desired number of points per channel, can return twice more + + + @BasicInstrument.tsdb_append + def getTimePerDiv(self): + qstr = 'TDIV?' + rstr = self.query(qstr) + # Siglent claims that this model should have same commands as SDS1104X + # however response is different, for example we got '2.00E-08S' instead 'TDIV 2.00E-08S' + # expected reply to query: '2.00E-08S' + spltStr=re.split('S', rstr) + numberString = spltStr[0] + #prefix, numberString, unit = response2numStr(rstr, firstSeparator=None, unit='S') + return(float(numberString)) + -- cgit v1.2.3