Commit 501ae8f660f4984cd758ca0c69caac18446efce2
1 parent
cac4c932ce
Exists in
master
-
Showing 1 changed file with 4 additions and 4 deletions Inline Diff
instruments/PM100D.py
| from abstract_instrument import abstract_instrument | 1 | 1 | from abstract_instrument import abstract_instrument | |
| import os | 2 | 2 | import os | |
| 3 | 3 | |||
| #============================================================================== | 4 | 4 | #============================================================================== | |
| 5 | 5 | |||
| ALL_VAL_TYPE = ['PWR'] | 6 | 6 | ALL_VAL_TYPE = ['PWR'] | |
| ALL_CHANNELS = ['1'] | 7 | 7 | ALL_CHANNELS = ['1'] | |
| 8 | 8 | |||
| ADRESS = "/dev/usbtmc0" | 9 | 9 | ADRESS = "/dev/usbtmc0" | |
| CONF_VAL_TYPE = ['PWR'] | 10 | 10 | CONF_VAL_TYPE = ['PWR'] | |
| 11 | 11 | |||
| #============================================================================== | 12 | 12 | #============================================================================== | |
| 13 | 13 | |||
| class PM100D(abstract_instrument): | 14 | 14 | class PM100D(abstract_instrument): | |
| def __init__(self, channels, vtypes, adress): | 15 | 15 | def __init__(self, channels, vtypes, adress): | |
| self.adress = adress | 16 | 16 | self.adress = adress | |
| self.channels = channels | 17 | 17 | self.channels = channels | |
| self.vtypes = vtypes | 18 | 18 | self.vtypes = vtypes | |
| 19 | 19 | |||
| def model(self): | 20 | 20 | def model(self): | |
| #self.send("*IDN?") | 21 | 21 | #self.send("*IDN?") | |
| #return self.read() | 22 | 22 | #return self.read() | |
| return "PM100D" | 23 | 23 | return "PM100D" | |
| 24 | 24 | |||
| def connect(self): | 25 | 25 | def connect(self): | |
| print('Connecting to device @%s...' %(self.adress)) | 26 | 26 | print('Connecting to device @%s...' %(self.adress)) | |
| self.FILE = os.open(self.adress, os.O_RDWR) | 27 | 27 | self.FILE = os.open(self.adress, os.O_RDWR) | |
| print(' --> Ok') | 28 | 28 | print(' --> Ok') | |
| print(self.model()) | 29 | 29 | print(self.model()) | |
| self.configure() | 30 | 30 | self.configure() | |
| 31 | 31 | |||
| def configure(self): | 32 | 32 | def configure(self): | |
| pass | 33 | 33 | pass | |
| 34 | 34 | |||
| def getValue(self): | 35 | 35 | def getValue(self): | |
| self.send("READ?") | 36 | 36 | self.send("READ?") | |
| return self.read() | 37 | 37 | return self.read() | |
| 38 | 38 |