Skip to content

Commit

Permalink
Added driver for the HP 83712B CWG
Browse files Browse the repository at this point in the history
  • Loading branch information
jclederman committed Nov 12, 2024
1 parent 2d08baf commit 8b67281
Showing 1 changed file with 37 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']
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?")))



0 comments on commit 8b67281

Please sign in to comment.