Example #1
0
    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.') 
Example #2
0
 def __init__(self,
              name='E8257D',
              address='',
              enabled=True,
              timeout=10,
              recv_length=1024):
     SocketInstrument.__init__(self, name, address, enabled, timeout,
                               recv_length)
Example #3
0
 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
Example #4
0
 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)
Example #5
0
 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)
Example #6
0
    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")
Example #7
0
 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
Example #8
0
    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.')
Example #9
0
 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
Example #10
0
 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
Example #11
0
 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)
Example #12
0
 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])
Example #13
0
 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])
Example #14
0
 def __init__(self, name='BNCAWG', address='', enabled=True, timeout=1000, recv_length=1024):
     SocketInstrument.__init__(self, name, address, enabled, timeout, recv_length)
Example #15
0
 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
Example #16
0
    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)
Example #17
0
 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
Example #18
0
 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