diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-05-31 16:18:23 -0400 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2022-05-31 16:18:23 -0400 |
commit | ba2b3ed0c8faff18905dd7191eea24653fdf8667 (patch) | |
tree | 38fb785b8b1b4e7d522deb8c5fd14ede64998727 /qolab/hardware | |
parent | 8753da0612d3294fbd9d8ae314b1f95cb04cc862 (diff) | |
download | qolab-ba2b3ed0c8faff18905dd7191eea24653fdf8667.tar.gz qolab-ba2b3ed0c8faff18905dd7191eea24653fdf8667.zip |
added aquisition of Freq from hardware
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 |