示例#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'}
示例#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)
示例#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'
     ]
示例#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
示例#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)
示例#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']
示例#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)
示例#8
0
 def __init__(self):
     SCPI.__init__(self, '/dev/ttyS0', 'serial')
     self.f.baudrate = 19200
     self.f.timeout = 5
示例#9
0
 def __init__(self, name='microreactor-agilent-34972a'):
     #SCPI.__init__(self,'/dev/usbtmc1','file')
     SCPI.__init__(self, name, 'lan')
示例#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)
示例#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)
示例#12
0
 def __init__(self, interface = 'lan', hostname=''):
     if interface == 'lan':
         SCPI.__init__(self, interface=interface, hostname=hostname)
示例#13
0
 def __init__(self, name='microreactor-agilent-34972a'):
     #SCPI.__init__(self,'/dev/usbtmc1','file')
     SCPI.__init__(self, interface='lan', hostname=name)