Загрузил(а) файлы в 'Project'

This commit is contained in:
Дмитрий Пунов 2022-12-05 12:27:44 +03:00
parent 2402a96f2b
commit 1d73cd6f68

19
Project/power_unit.py Normal file
View 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())