Skip to content

Commit

Permalink
Merge pull request #49 from lightwave-lab/josh_staged
Browse files Browse the repository at this point in the history
Added HP 83712B CWG, added filter controls to Keithley 2606B
  • Loading branch information
jclederman authored Nov 12, 2024
2 parents e3e261c + 06f8e61 commit 511ed4a
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
37 changes: 37 additions & 0 deletions lightlab/equipment/lab_instruments/HP_83712B_CWG.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from . import VISAInstrumentDriver

class HP_83712B_CWG(VISAInstrumentDriver):
'''
HP 83712B Synthesized Continuous Wave Generator
`Manual <https://www.keysight.com/us/en/product/83712B/synthesized-cw-generator-10-mhz-to-20-ghz.html>`_
'''

def __init__(self, name='Continuous Wave Generator', address=None, **kwargs):
VISAInstrumentDriver.__init__(self, name=name, address=address, **kwargs)

def reset(self):
self.write('*RST')

def enable(self, newState=None):
trueWords = [True, 1, '1', 'ON', "+1"]
if newState is not None:
if newState:
self.write(f"OUTP ON")
else:
self.write(f"OUTP OFF")
return self.query("OUTP?") in trueWords

def frequency(self, newFreq=None):
if newFreq is not None:
self.write(f"FREQ {newFreq}")
return(float(self.query("FREQ?")))

# Units of dBm
def power(self, newPower=None):
if newPower is not None:
self.write(f"POW {newPower}")
return(float(self.query("POW?")))



21 changes: 21 additions & 0 deletions lightlab/equipment/lab_instruments/Keithley_2606B_SMU.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,3 +385,24 @@ def setCurrentMode(self, protectionVoltage=1):
self.__setSourceMode(isCurrentSource=True)
self.setProtectionVoltage(protectionVoltage)
self._configCurrent(0)

def getFilterParams(self):
filters = ['', 'Repeat Average', 'Moving Average', 'Median']

enable_str = self.query_print(f"{self.smu_full_string}.measure.filter.enable")
type_str = self.query_print(f"{self.smu_full_string}.measure.filter.type")
count_str = self.query_print(f"{self.smu_full_string}.measure.filter.count")

return True if int(float(enable_str)) else False, filters[int(float(type_str))], int(float(count_str))

def enableFilter(self):
self.write(f"{self.smu_full_string}.measure.filter.enable = {self.smu_full_string}.FILTER_ON")

def disableFilter(self):
self.write(f"{self.smu_full_string}.measure.filter.enable = {self.smu_full_string}.FILTER_OFF")

def setFilterRepeat(self):
self.write(f"{self.smu_full_string}.measure.filter.type = {self.smu_full_string}.FILTER_REPEAT_AVG")

def setFilterCount(self, count):
self.write(f"{self.smu_full_string}.measure.filter.count = {count}")

0 comments on commit 511ed4a

Please sign in to comment.