Blame view

instruments/Sym5125A.py 1.12 KB
3a0af875b   bmarechal   add Symmetricom 5...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  from abstract_instrument import abstract_instrument
  import telnetlib, time
  
  #==============================================================================
  
  ALL_VAL_TYPE = ['phase']
  ALL_CHANNELS = ['1']
  
  ADDRESS = "192.168.0.222"
  CONF_VAL_TYPE = ['phase']
  
  #==============================================================================
  
  class Sym5125A(abstract_instrument):
      def __init__(self, channels, vtypes, address):
          self.address = address
          self.channels = channels
          self.vtypes = vtypes
  
      def model(self):
          #self.send("*IDN?")
          #return self.read()
          return "Sym5125A"
  
      def connect(self):
          print('Connecting to device @%s...' %(self.address))
          self.tn = telnetlib.Telnet(self.address, '1298')
          #time.sleep(1)
          print('  --> Ok')
          print(self.model())
          self.configure()
  
      def configure(self):
          pass
  
      def getValue(self):
84ec7275a   bmarechal   add \n
37
38
39
40
41
          mes = self.tn.read_until('
  ').replace('\r
  ','')
          return mes + '
  '
3a0af875b   bmarechal   add Symmetricom 5...
42
43
44
45
46
47
48
49
50
  
      def read(self):
          pass
  
      def disconnect(self):
          self.tn.close()
  
      def send(self, command):
          pass