diff options
Diffstat (limited to 'qolab/hardware')
-rw-r--r-- | qolab/hardware/rf_generator/qol_lmx2487.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/qolab/hardware/rf_generator/qol_lmx2487.py b/qolab/hardware/rf_generator/qol_lmx2487.py index 2c9e121..c81b71b 100644 --- a/qolab/hardware/rf_generator/qol_lmx2487.py +++ b/qolab/hardware/rf_generator/qol_lmx2487.py @@ -1,6 +1,7 @@ from qolab.hardware.basic import BasicInstrument from qolab.hardware.rf_generator import RFGenerator import serial +import re class QOL_LMX2487(RFGenerator): @@ -52,10 +53,12 @@ class QOL_LMX2487(RFGenerator): @BasicInstrument.tsdb_append def getFreqFixed(self): - """ - getFreqFixed unable to get frequency from hardware. - So we use value from previews setFreqFixed. - """ + # talking to hardware is slow, so we use cached value if we can + if self._FreqFixed is None: + resp = self.sendSerialCmd('getFreq()') + m = re.search('[0-9.]+', resp) + if m is not None: + self._FreqFixed = float(m.group()) return self._FreqFixed |