Ejemplo n.º 1
0
 def __init__(self, interface, hostname='', device=''):
     if interface == 'serial':
         SCPI.__init__(self, interface=interface, device=device)
         self.f.baudrate = 19200
         self.f.timeout = 5
     if interface == 'lan':
         SCPI.__init__(self, interface=interface, hostname=hostname)
     self.channel_names = {1: 'a', 2: 'b'}
Ejemplo n.º 2
0
 def __init__(self, output, interface = 'serial', hostname='', device='', tcp_port=0):
     if interface == 'lan':
         SCPI.__init__(self, 'lan', tcp_port=tcp_port, hostname=hostname)
     if interface == 'serial':
         SCPI.__init__(self, 'serial', device=device)
     if not (output == 1 or output == 2):
         raise InterfaceOutOfBoundsError(output)
     else:
         self.output = str(output)
Ejemplo n.º 3
0
 def __init__(self, interface='serial', hostname='', device='', tcp_port=0):
     if interface == 'lan':
         SCPI.__init__(self, 'lan', tcp_port=tcp_port, hostname=hostname)
     if interface == 'serial':
         SCPI.__init__(self, 'serial', device=device)
     self.unit_list = [
         'VDC', 'VAC', 'ADC', 'AAC', 'OHM', 'OHM4W', 'HZ', 'SECS', 'C', 'F',
         'K'
     ]
Ejemplo n.º 4
0
class vnaCom():
        
        def __init__(self, device, ip):
            try:
                self.device = device
                self.comlink = serial.Serial(*device)
            except:
                 print("Could not open ",device)
                 raise
            self.scpi = SCPI(ip)

        
        def __del__(self):
               self.comlink.close()

        def sendMagAndPhase(self):
            (mag,phase) = self.scpi.getMagAndPhase()

            # Format is mag,phase (floats);
            command = b"{0},{1}\n".format(mag, phase)
            self.comlink.write(command)

            self.comlink.flush()
            return (mag,phase)

        def waitForRequest(self):
            response = self.comlink.readline()

            while response.find('GETMAGPHASE') != 0 :
                response = self.comlink.readline()
                print response
Ejemplo n.º 5
0
 def __init__(self, device, ip):
     try:
         self.device = device
         self.comlink = serial.Serial(*device)
     except:
          print("Could not open ",device)
          raise
     self.scpi = SCPI(ip)
Ejemplo n.º 6
0
 def __init__(self, interface = 'serial', hostname='', device='', tcp_port=0):
     if interface == 'lan':
         SCPI.__init__(self, 'lan', tcp_port=tcp_port, hostname=hostname)
     if interface == 'serial':
         SCPI.__init__(self, 'serial', device=device)
     self.unit_list = ['VDC', 'VAC', 'ADC', 'AAC', 'OHM', 'OHM4W', 'HZ', 'SECS', 'C', 'F', 'K']
Ejemplo n.º 7
0
 def __init__(self, port='ttyUSB0', name='microreactor-agilent-34972a'):
     #SCPI.__init__(self,'/dev/usbtmc1','file')
     SCPI.__init__(self, interface='serial', device = port, hostname=name)
Ejemplo n.º 8
0
 def __init__(self):
     SCPI.__init__(self, '/dev/ttyS0', 'serial')
     self.f.baudrate = 19200
     self.f.timeout = 5
Ejemplo n.º 9
0
 def __init__(self, name='microreactor-agilent-34972a'):
     #SCPI.__init__(self,'/dev/usbtmc1','file')
     SCPI.__init__(self, name, 'lan')
Ejemplo n.º 10
0
 def __init__(self, port='ttyUSB0', name='microreactor-agilent-34972a'):
     #SCPI.__init__(self,'/dev/usbtmc1','file')
     SCPI.__init__(self, interface='serial', device=port, hostname=name)
Ejemplo n.º 11
0
 def __init__(self,output,usbchannel = 0):
     SCPI.__init__(self,'/dev/ttyACM' + str(usbchannel),'serial')
     if not (output == 1 or output == 2):
         raise InterfaceOutOfBoundsError(output)
     else:
         self.output = str(output)
Ejemplo n.º 12
0
 def __init__(self, interface = 'lan', hostname=''):
     if interface == 'lan':
         SCPI.__init__(self, interface=interface, hostname=hostname)
Ejemplo n.º 13
0
 def __init__(self, name='microreactor-agilent-34972a'):
     #SCPI.__init__(self,'/dev/usbtmc1','file')
     SCPI.__init__(self, interface='lan', hostname=name)