diff --git a/src/auspex/instruments/dsinstruments.py b/src/auspex/instruments/dsinstruments.py index 08431ca9..334f4289 100644 --- a/src/auspex/instruments/dsinstruments.py +++ b/src/auspex/instruments/dsinstruments.py @@ -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 @@ -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}') diff --git a/src/auspex/instruments/keysight.py b/src/auspex/instruments/keysight.py index 46e65cfa..144200ad 100644 --- a/src/auspex/instruments/keysight.py +++ b/src/auspex/instruments/keysight.py @@ -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" @@ -329,3 +330,4 @@ def advance(self, channel=1): def trigger(self, channel=1): self.interface.write(":TRIG:BEG{:d}".format(channel)) +