diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-01-02 18:22:04 -0500 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-01-02 18:22:04 -0500 |
commit | bf375142e009aaaa7a517b67e5842d493ae0206a (patch) | |
tree | 9ac4c8e5cf7a93aeb21e2b3773cbea4508d32a49 /qolab | |
parent | dad9f4cc3aaaf700fd214552774ce8c64fdec738 (diff) | |
download | qolab-bf375142e009aaaa7a517b67e5842d493ae0206a.tar.gz qolab-bf375142e009aaaa7a517b67e5842d493ae0206a.zip |
redo lockin via SCPI_PROPERTY
Diffstat (limited to 'qolab')
-rw-r--r-- | qolab/hardware/lockin/srs_sr865a.py | 135 |
1 files changed, 40 insertions, 95 deletions
diff --git a/qolab/hardware/lockin/srs_sr865a.py b/qolab/hardware/lockin/srs_sr865a.py index 3d3ebfc..727c54e 100644 --- a/qolab/hardware/lockin/srs_sr865a.py +++ b/qolab/hardware/lockin/srs_sr865a.py @@ -1,5 +1,11 @@ from qolab.hardware.basic import BasicInstrument from qolab.hardware.lockin import LockinSCPI +from qolab.hardware.scpi import SCPI_PROPERTY +from enum import IntEnum, EnumMeta + +class TimeBaseOption(IntEnum): + AUTO=0 + INT=1 class SRS_SR865A(LockinSCPI): """ SRS SR865A lockin """ @@ -9,101 +15,40 @@ class SRS_SR865A(LockinSCPI): self.resource.read_termination='\n' self.deviceProperties.extend(['TimeBaseMode']) - @BasicInstrument.tsdb_append - def getFreqInt(self): - qstr = f'FreqInt?' - rstr = self.query(qstr) - return(float(rstr)) - - @BasicInstrument.tsdb_append - def setFreqInt(self, freq): - cstr = f'FreqInt {freq}' - rstr = self.write(cstr) - - # this one has only getter - @BasicInstrument.tsdb_append - def getFreqExt(self): - qstr = f'FreqExt?' - rstr = self.query(qstr) - return(float(rstr)) - - @BasicInstrument.tsdb_append - def getHarm(self): - qstr = f'Harm?' - rstr = self.query(qstr) - return(int(rstr)) - - @BasicInstrument.tsdb_append - def setHarm(self, harm): - cstr = f'Harm {harm}' - rstr = self.write(cstr) - - @BasicInstrument.tsdb_append - def getSinAmpl(self): - qstr = f'SLVL?' - rstr = self.query(qstr) - return(float(rstr)) - - @BasicInstrument.tsdb_append - def setSinAmpl(self, ampl): - cstr = f'SLVL {ampl}' - rstr = self.write(cstr) - - @BasicInstrument.tsdb_append - def getSinOffset(self): - qstr = f'SOFF?' - rstr = self.query(qstr) - return(float(rstr)) - - @BasicInstrument.tsdb_append - def setSinOffset(self, offset): - cstr = f'SOFF {offset}' - rstr = self.write(cstr) - - @BasicInstrument.tsdb_append - def getSensetivity(self): - return(int(self.query(f'SCAL?'))) - - @BasicInstrument.tsdb_append - def setSensetivity(self, val): - rstr = self.write(f'SCAL {val}') - - @BasicInstrument.tsdb_append - def getTimeConstan(self): - return(int(self.query(f'OFLT?'))) - - @BasicInstrument.tsdb_append - def setTimeConstan(self, val): - rstr = self.write(f'OFLT {val}') - - @BasicInstrument.tsdb_append - def getFilterSlope(self): - return(int(self.query(f'OFSL?'))) - - @BasicInstrument.tsdb_append - def setFilterSlope(self, val): - rstr = self.write(f'OFSL {val}') - - # this one has only getter - @BasicInstrument.tsdb_append - def getEquivalentFileterBW(self): - return(float(self.query(f'ENBW?'))) - - @BasicInstrument.tsdb_append - def getTimeBaseMode(self): - return(int(self.query(f'TBMODE?'))) - - @BasicInstrument.tsdb_append - def setTimeBaseMode(self, val): - rstr = self.write(f'TBMODE {val}') - - @BasicInstrument.tsdb_append - def getRefPhase(self): - return(float(self.query(f'PHAS?'))) - - @BasicInstrument.tsdb_append - def setRefPhase(self, val): - rstr = self.write(f'PHAS {val}') + FreqInt = SCPI_PROPERTY(scpi_prfx='FreqInt', ptype=float, doc='Internal LO frequency') + FreqExt = SCPI_PROPERTY(scpi_prfx='FreqExt', ptype=float, doc='External LO frequency', no_setter=True) + Harm = SCPI_PROPERTY(scpi_prfx='Harm', ptype=float, doc='Harmonic of the LO') + SinAmpl = SCPI_PROPERTY(scpi_prfx='SLVL', ptype=float, doc='Modulation amplitude') + SinOffset = SCPI_PROPERTY(scpi_prfx='SOFF', ptype=float, doc='Modulation offset') + EquivalentNoiseBW = SCPI_PROPERTY(scpi_prfx='ENBW', ptype=float, doc='Equivalent Noise BandWidth (it is not 3dB BW, see the manual)', no_setter=True) + TimeBaseMode = SCPI_PROPERTY(scpi_prfx='TBMODE', ptype=int, doc='10 MHz reference mode: 0 - Auto, 1 - Internal') + RefPhase = SCPI_PROPERTY(scpi_prfx='PHAS', ptype=float, doc='LO/reference phase') + + Sensitivity = SCPI_PROPERTY(scpi_prfx='SCAL', ptype=int, doc=""" + Sensitivity: + 0: 1 V (uA), 6: 10 mV (nA), ... 27: 1 nV (fA) + 1: 500 mV (nA), 7: 5 mV (nA), + 2: 200 mV (nA), 8: 2 mV (nA), + 3: 100 mV (nA), 9: 1 mV (nA), + 4: 50 mV (nA), 10: 500 uV (pA), + 5: 20 mV (nA), 11: 200 uV (pA), + """) + TimeConstan = SCPI_PROPERTY(scpi_prfx='OFLT', ptype=int, doc=""" + Time constant: + 0: 1 uS, 6: 1 mS, ..... , 21: 30 kS + 1: 3 uS, 7: 3 mS, + 2: 10 uS, 8: 10 mS, + 3: 30 uS, 9: 30 mS, + 4: 100 uS, 10: 100 mS, + 5: 300 uS, 11: 300 mS, + """) + FilterSlope = SCPI_PROPERTY(scpi_prfx='OFSL', ptype=int, doc=""" + Output Filter slope: + 0: 6dB/Oct + 1: 12dB/Oct + 2: 18dB/Oct + 3: 24dB/Oct + """) if __name__ == '__main__': import pyvisa |