Загрузил(а) файлы в 'Project'
This commit is contained in:
parent
2402a96f2b
commit
1d73cd6f68
19
Project/power_unit.py
Normal file
19
Project/power_unit.py
Normal file
@ -0,0 +1,19 @@
|
||||
import check_connection
|
||||
import serial
|
||||
|
||||
|
||||
class Agilent():
|
||||
|
||||
def __init__(self, folder):
|
||||
self.folder = folder
|
||||
self.instr = serial.Serial(
|
||||
self.folder, timeout=1, inter_byte_timeout=1)
|
||||
msg = 'OUTput on\n'
|
||||
self.instr.write(msg.encode('ascii'))
|
||||
|
||||
def setVoltageDC(self, volt):
|
||||
self.instr.write(('VOLTage '+str(volt)+'\n').encode('ascii'))
|
||||
|
||||
def getID(self):
|
||||
self.instr.write(('*IDN?\n').encode('ascii'))
|
||||
print(self.instr.read(100).decode().rstrip())
|
Loading…
Reference in New Issue
Block a user