Skip to content

Commit

Permalink
Added support for DSInstruments attenuator. Also added trigger freque…
Browse files Browse the repository at this point in the history
…ncy setting to Keysight AWG
  • Loading branch information
qlab committed Mar 1, 2024
1 parent 7f68f19 commit 34404a5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
37 changes: 36 additions & 1 deletion src/auspex/instruments/dsinstruments.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# Drivers for controling the DS Instruments puresine rf signal generators

__all__ = ['DSInstrumentsSG12000', 'DSInstrumentsSG12000Pro']
__all__ = ['DSInstrumentsSG12000', 'DSInstrumentsSG12000Pro','DAT64H']

from auspex.log import logger
from .instrument import SCPIInstrument, MetaInstrument, StringCommand, FloatCommand, IntCommand, RampCommand, BoolCommand
Expand Down Expand Up @@ -141,3 +141,38 @@ def detect_ext_ref(self):

def temp(self): #Is this working?
return self.interface.query("*TEMPC?")

class DAT64H(SCPIInstrument,metaclass=MakeSettersGetters):

instrument_type = "Tunable Attenuator"
bool_map = {'ON':1, 'OFF':0}
bool_map_inv = {1:'ON', 0:'OFF'}

attenuation = FloatCommand(scpi_string="ATT")
step = FloatCommand(scpi_string="STEP")

def __init__(self, resource_name=None, *args, **kwargs):
super(DAT64H, self).__init__(resource_name, *args, **kwargs)

def connect(self, resource_name=None, interface_type="VISA"):
if resource_name is not None:
self.resource_name = resource_name
super(DAT64H, self).connect(resource_name=self.resource_name, interface_type=interface_type)
self.interface._resource.read_termination = u"\r\n"
self.interface._resource.write_termination = u"\r\n"
self.interface._resource.timeout = 1000
self.interface._resource.baud_rate = 115200

def increment(self):
self.interface.write("INCR")

def decrement(self):
self.interface.write("DECR")

@property
def attenuation(self):
return self.interface.query('ATT?')

@attenuation.setter
def attenuation(self,value):
self.interface.write(f'ATT {value}')
4 changes: 3 additions & 1 deletion src/auspex/instruments/keysight.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ class KeysightM8190A(SCPIInstrument):

continuous_mode = StringCommand(scpi_string=":INIT:CONT:STAT", value_map={True:"1", False:"0"})
gate_mode = StringCommand(scpi_string=":INIT:GATE:STAT", value_map={True:"1", False:"0"})

trigger_frequency = FloatCommand(scpi_string=":ARM:TRIG:FREQ")

def __init__(self, resource_name, *args, **kwargs):
super(KeysightM8190A, self).__init__(resource_name, *args, **kwargs)
self.name = "KeysightM8190A AWG"
Expand Down Expand Up @@ -329,3 +330,4 @@ def advance(self, channel=1):

def trigger(self, channel=1):
self.interface.write(":TRIG:BEG{:d}".format(channel))

0 comments on commit 34404a5

Please sign in to comment.