def __init__(self, name='spec_analyzer', protocol='socket', address='', port=23, enabled=True, timeout=.1, recv_length=1024, query_sleep=0.005, lo_power=10, lo_offset=10.55e6, baudrate=115200): self.lo_offset = lo_offset self.lo_power = lo_power if (address.count('.') == 3): #the address is in an IP address format self.protocol = 'socket' else: #otherwise we treat the address as port self.protocol = 'serial' if address != '': port = int(address) if self.protocol == 'serial': SerialInstrument.__init__(self, name, port, enabled, timeout, recv_length, baudrate=baudrate, querysleep=query_sleep) self.term_char = '' time.sleep(2) print(self.read()) elif self.protocol == 'socket': if ':' in address: SocketInstrument.__init__(self, name, address, enabled, timeout, recv_length) else: SocketInstrument.__init__(self, name, address+':'+str(port), enabled, timeout, recv_length) self.recv_length = recv_length self.term_char = '' self.query_sleep = query_sleep else: print('The protocol requested is not valid.')
def __init__(self, name='E8257D', address='', enabled=True, timeout=10, recv_length=1024): SocketInstrument.__init__(self, name, address, enabled, timeout, recv_length)
def __init__(self, name="E4440", address=None, enabled=True): SocketInstrument.__init__(self, name, address, enabled=enabled, timeout=1.0, recv_length=2**20) self.query_sleep = 0.05
def __init__(self, name="Cryocon", address=None, enabled=True): SocketInstrument.__init__(self, name, address, enabled=enabled, timeout=1, recv_length=2**20) self.query_sleep = 0.05 self.socket.setblocking(1)
def __init__(self, name='N5183B', address='', enabled=True, timeout=10, recv_length=1024): SocketInstrument.__init__(self, name=name, address=address, enabled=enabled, timeout=timeout, recv_length=recv_length)
def __init__(self, name='BNC845', address='', enabled=True, timeout=10, recv_length=1024): #SocketInstrument.__init__(self,name,address,5025,enabled,timeout,recv_length) SocketInstrument.__init__(self, name, address, enabled, timeout, recv_length) #default set to external reference self.set_reference_source("EXT")
def __init__(self, name='AD5780', address='', enabled=True, timeout=1, recv_length=1024): SocketInstrument.__init__(self, name, address, enabled=enabled, timeout=timeout, recv_length=recv_length) self.query_sleep = 0.01
def __init__(self, name='spec_analyzer', protocol='socket', address='', port=23, enabled=True, timeout=.1, recv_length=1024, query_sleep=0.005, lo_power=10, lo_offset=10.55e6, baudrate=115200): self.lo_offset = lo_offset self.lo_power = lo_power if (address.count('.') == 3): #the address is in an IP address format self.protocol = 'socket' else: #otherwise we treat the address as port self.protocol = 'serial' if address != '': port = int(address) if self.protocol == 'serial': SerialInstrument.__init__(self, name, port, enabled, timeout, recv_length, baudrate=baudrate, querysleep=query_sleep) self.term_char = '' time.sleep(2) print(self.read()) elif self.protocol == 'socket': if ':' in address: SocketInstrument.__init__(self, name, address, enabled, timeout, recv_length) else: SocketInstrument.__init__(self, name, address + ':' + str(port), enabled, timeout, recv_length) self.recv_length = recv_length self.term_char = '' self.query_sleep = query_sleep else: print('The protocol requested is not valid.')
def get_settings(self): settings = SocketInstrument.get_settings(self) settings['id'] = self.get_id() settings['output'] = self.get_output() settings['frequency'] = self.get_frequency() settings['function'] = self.get_function() settings['amplitude'] = self.get_amplitude() settings['offset'] = self.get_offset() return settings
def get_settings(self): settings = SocketInstrument.get_settings(self) settings['id'] = self.get_id() settings['output'] = self.get_output() settings['frequency'] = self.get_frequency() settings['function'] = self.get_function() settings['amplitude'] = self.get_amplitude() settings['offset'] = self.get_offset() return settings
def get_settings(self): settings = SocketInstrument.get_settings(self) settings['frequency'] = self.get_frequency() settings['power'] = self.get_power() settings['phase'] = self.get_phase() #settings['mod']=self.get_mod() settings['output'] = self.get_output() settings['id'] = self.get_id() return settings
def __init__(self, name="E5071", address=None, enabled=True, **kwargs): SocketInstrument.__init__(self, name, address, enabled=enabled, recv_length=2 ** 20, **kwargs) self.query_sleep = 0.05 self.timeout = 100
def __init__(self, name='M8195A', address='', enabled=True,timeout = 1000): address = address.upper() SocketInstrument.__init__(self, name, address, enabled=enabled, timeout=timeout) self._loaded_waveforms = [] self.socket.setblocking(1)
def __del__(self): if self.protocol == 'serial': SerialInstrument.__del__(self) if self.protocol == 'socket': self.write('END') SocketInstrument.__del__(self)
def __init__(self, name="Omega16i", address=None, enabled = True ): SocketInstrument.__init__(self, name, address, enabled=enabled, timeout=10, recv_length=2**20) self.query_sleep = 0.05
def read(self): if self.protocol == 'serial': return SerialInstrument.read(self) if self.protocol == 'socket': return SocketInstrument.read(self)
def write(self, s): if self.protocol == 'serial': SerialInstrument.write(self, s) if self.protocol == 'socket': SocketInstrument.write(self, s)
def __init__(self, name="MCRCA18", address="192.168.14.138:80"): SocketInstrument.__init__(self, name=name, address='192.168.14.138:80') self.tcp_ip = address.split(":")[0] self.tcp_port = int(address.split(":")[1])
def __init__(self, name='YOKO', address='', enabled=True, recv_length=1024,timeout=10): SocketInstrument.__init__(self, name=name, address=address, enabled=enabled, recv_length=recv_length,timeout=timeout) self.query_sleep=0.01
def write(self, s): if self.protocol == 'serial': SerialInstrument.write(self, s) if self.protocol == 'socket': SocketInstrument.write(self, s)
def __del__(self): if self.protocol == 'serial': SerialInstrument.__del__(self) if self.protocol == 'socket': self.write('END') SocketInstrument.__del__(self)
def read(self): if self.protocol == 'serial': return SerialInstrument.read(self) if self.protocol == 'socket': return SocketInstrument.read(self)
def get_settings(self): settings = SocketInstrument.get_settings(self) settings.update(self.get_temperatures()) settings.update(self.get_pressures()) return settings
def __init__(self, name = "MCRCA18", address = "192.168.14.138:80"): SocketInstrument.__init__(self, name = name, address = '192.168.14.138:80') self.tcp_ip = address.split(":")[0] self.tcp_port = int(address.split(":")[1])
def __init__(self, name='AD5780', address='', enabled=True, timeout=1, recv_length=1024): SocketInstrument.__init__(self, name, address, enabled=enabled, timeout=timeout, recv_length=recv_length) self.query_sleep=0.01
def __init__(self, name='BNCAWG', address='', enabled=True, timeout=1000, recv_length=1024): SocketInstrument.__init__(self, name, address, enabled, timeout, recv_length)
def __init__(self, name="Triton", address='slab-fridge1.uchicago.edu', enabled=True, timeout=1.0): # if ':' not in address: address+=':22518' SocketInstrument.__init__(self, name, address, enabled, timeout) self.recv_length = 65536
def __init__(self, name="Cryocon", address=None, enabled=True): SocketInstrument.__init__(self, name, address, enabled=enabled, timeout=1, recv_length=2 ** 20) self.query_sleep = 0.05 self.socket.setblocking(1)