Commit 792ebb9829207215345007e1979fa41ac5bddbcc

Authored by bmarechal
1 parent acf3be97df
Exists in master

-

Showing 1 changed file with 11 additions and 7 deletions Side-by-side Diff

instruments/HP53132A.py
... ... @@ -3,11 +3,11 @@
3 3  
4 4 #==============================================================================
5 5  
6   -ALL_VAL_TYPE = ['FREQ']
7   -ALL_CHANNELS = ['1', '2']
  6 +ALL_VAL_TYPE = ['FREQ'] #, 'PERIOD']
  7 +ALL_CHANNELS = ['1'] #, '2']
8 8  
9 9 ADRESS = "192.168.0.52"
10   -CONF_VAL_TYPE = [':FETCH:FREQ?']
  10 +CONF_VAL_TYPE = ['CONF:FREQ'] #, 'CONF:PERIOD']
11 11  
12 12 #==============================================================================
13 13  
14 14  
15 15  
16 16  
... ... @@ -39,16 +39,20 @@
39 39 def configure(self):
40 40 self.strCh = ''
41 41 for ch in self.channels:
42   - self.strCh = self.strCh + '%s;'%(CONF_VAL_TYPE[ALL_VAL_TYPE.index(self.vtypes[self.channels.index(ch)])])
  42 + self.send('%s (@%s)'%(CONF_VAL_TYPE[ALL_VAL_TYPE.index(self.vtypes[self.channels.index(ch)])], ch))
  43 + self.strCh = self.strCh + '(@%s),'%ch
43 44 self.strCh = self.strCh[0:-1]
44   - self.send(':FORMAT ASCII')
  45 + self.send('FORMAT ASCII')
  46 +
  47 + #self.send('ROUT:SCAN (@%s)'%self.strCh)
  48 + #self.send('TRIG:COUN 1')
  49 + self.send('*RST')
45 50 self.send(":FUNC 'FREQ 1'")
46 51 self.send(":ROSC:SOUR INT")
47 52 self.send(":INIT:CONT ON")
48   - print(self.strCh)
49 53  
50 54 def getValue(self):
51   - self.send(self.strCh)
  55 + self.send('FETC?')
52 56 return self.read()
53 57  
54 58 def read(self):