diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-12-09 21:34:49 -0500 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2021-12-09 21:34:49 -0500 |
commit | 9e5768d7377ce84ad3cdcd9e221357c5e6719cb0 (patch) | |
tree | 569db8287836792e3d5158aa6b43405a1022793e | |
parent | 13892e556d475cf34ae4e2424d45ff93580dca26 (diff) | |
download | qolab-9e5768d7377ce84ad3cdcd9e221357c5e6719cb0.tar.gz qolab-9e5768d7377ce84ad3cdcd9e221357c5e6719cb0.zip |
polished draft of lockin functions
-rw-r--r-- | qolab/hardware/lockin/__init__.py | 5 | ||||
-rw-r--r-- | qolab/hardware/lockin/srs_sr865a.py | 12 |
2 files changed, 14 insertions, 3 deletions
diff --git a/qolab/hardware/lockin/__init__.py b/qolab/hardware/lockin/__init__.py index 7c2f826..1385fcb 100644 --- a/qolab/hardware/lockin/__init__.py +++ b/qolab/hardware/lockin/__init__.py @@ -6,7 +6,9 @@ class Lockin(BasicInstrument): BasicInstrument.__init__(self) self.config['Device type']='Lockin' self.config['FnamePrefix'] = 'lockin' - self.deviceProperties = ['Freq']; + self.config['Device model'] = 'Generic Lockin Without Hardware interface' + self.config['FnamePrefix'] = 'lockin' + self.deviceProperties = ['FreqInt']; # Minimal set of methods to be implemented. pass @@ -21,7 +23,6 @@ class LockinSCPI(SCPIinstr, Lockin): SCPIinstr.__init__(self, resource) Lockin.__init__(self) self.config['DeviceId'] = str.strip(self.idn) - self.deviceProperties = ['FreqInt']; from .srs_sr865a import SRS_SR865A diff --git a/qolab/hardware/lockin/srs_sr865a.py b/qolab/hardware/lockin/srs_sr865a.py index 91e1978..1bddb6d 100644 --- a/qolab/hardware/lockin/srs_sr865a.py +++ b/qolab/hardware/lockin/srs_sr865a.py @@ -11,7 +11,15 @@ class SRS_SR865A(LockinSCPI): self.config['Device model']='SRS SR865A' self.resource.read_termination='\n' - """ Note: Fixed frequency and Center frequency (of sweep) are different in this model """ + def getFreqInt(self): + qstr = f'FreqInt?' + rstr = self.query(qstr) + return(float(rstr)) + + def setFreqInt(self, freq): + cstr = f'FreqInt {freq}' + rstr = self.write(cstr) + if __name__ == '__main__': import pyvisa @@ -20,6 +28,8 @@ if __name__ == '__main__': print(rm.list_resources()) instr=rm.open_resource('TCPIP::192.168.0.51::INSTR') lockin = SRS_SR865A(instr) + print('------ Header start -------------') print(str.join('\n', lockin.getHeader())) + print('------ Header ends -------------') |