Commit 3a0af875bd51383600f4ec1f7cfef3cffee80299
1 parent
77603816e3
Exists in
master
add Symmetricom 5125A phase support
Showing 1 changed file with 46 additions and 0 deletions Side-by-side Diff
instruments/Sym5125A.py
| 1 | +from abstract_instrument import abstract_instrument | |
| 2 | +import telnetlib, time | |
| 3 | + | |
| 4 | +#============================================================================== | |
| 5 | + | |
| 6 | +ALL_VAL_TYPE = ['phase'] | |
| 7 | +ALL_CHANNELS = ['1'] | |
| 8 | + | |
| 9 | +ADDRESS = "192.168.0.222" | |
| 10 | +CONF_VAL_TYPE = ['phase'] | |
| 11 | + | |
| 12 | +#============================================================================== | |
| 13 | + | |
| 14 | +class Sym5125A(abstract_instrument): | |
| 15 | + def __init__(self, channels, vtypes, address): | |
| 16 | + self.address = address | |
| 17 | + self.channels = channels | |
| 18 | + self.vtypes = vtypes | |
| 19 | + | |
| 20 | + def model(self): | |
| 21 | + #self.send("*IDN?") | |
| 22 | + #return self.read() | |
| 23 | + return "Sym5125A" | |
| 24 | + | |
| 25 | + def connect(self): | |
| 26 | + print('Connecting to device @%s...' %(self.address)) | |
| 27 | + self.tn = telnetlib.Telnet(self.address, '1298') | |
| 28 | + #time.sleep(1) | |
| 29 | + print(' --> Ok') | |
| 30 | + print(self.model()) | |
| 31 | + self.configure() | |
| 32 | + | |
| 33 | + def configure(self): | |
| 34 | + pass | |
| 35 | + | |
| 36 | + def getValue(self): | |
| 37 | + return self.tn.read_until('\n').replace('\r\n','') | |
| 38 | + | |
| 39 | + def read(self): | |
| 40 | + pass | |
| 41 | + | |
| 42 | + def disconnect(self): | |
| 43 | + self.tn.close() | |
| 44 | + | |
| 45 | + def send(self, command): | |
| 46 | + pass |