Skip to content

Commit

Permalink
Added draft Booton 4240 RF PM driver
Browse files Browse the repository at this point in the history
  • Loading branch information
jclederman committed Nov 13, 2024
1 parent 06f8e61 commit e7135fc
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions lightlab/equipment/lab_instruments/Boonton_4240_PM.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import time
from . import VISAInstrumentDriver

# TODO: Need to ensure the wait time matches the filter time properly, and implement waiting here

class Boonton_4240_PM(VISAInstrumentDriver):

def __init__(self, name="Booton 4240 PM", address=None, **kwargs):
VISAInstrumentDriver.__init__(self, name=name, address=address, **kwargs)

def reset(self):
return self.write("*RST")

def get_id(self):
return self.query("*IDN?")

def get_filter_time(self, channel=1):
return float(self.query(f"SENS{channel}:FILT:TIM?"))

def set_filter_time(self, time=0.05, channel=1):
self.time
self.write(f"SENS{channel}:FILT:TIM {time}")

def read(self, channel=1, wait_time=5):
for i in range(10):
try:
response = self.query(f"READ{channel}:CW:POW?", wait_time=wait_time) # Averaging time
break
except:
pass

splitted = response.split(",")
channel = int(splitted[0])
power = float(splitted[1])
return power


0 comments on commit e7135fc

Please sign in to comment.