files reorganized, measuring devices added

This commit is contained in:
Вадим Силаев 2022-12-12 12:06:11 +03:00
parent 5483d72d42
commit f660b77335
9 changed files with 74 additions and 1 deletions

30
3.5.1 auto/amperemeter.py Normal file
View File

@ -0,0 +1,30 @@
import serial
class B7_78():
def __init__(self, folder):
self.folder = folder
self.instr = serial.Serial(
self.folder, timeout=1, inter_byte_timeout=1)
self.instr.write(b'SYST:REM\n')
self.instr.write(b'SYST:REM\n')
def getCurrentDC(self):
self.instr.write(b'MEAS:CURR:DC?\n')
return self.instr.read(100).decode().rstrip()
def getVoltageDC(self):
self.instr.write(b'MEAS:VOLT:DC?\n')
return float(self.instr.read(100).decode().rstrip())
def getCurrentAC(self):
self.instr.write(b'MEAS:CURR:AC?\n')
return float(self.instr.read(100).decode().rstrip())
def getVoltageAC(self):
self.instr.write(b'MEAS:VOLT:AC?\n')
return float(self.instr.read(100).decode().rstrip())
# for i in range(5):
# print(B7_78('/dev/ttyUSB0').getCurrentDC())

View File

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

View File

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

View File

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

43
3.5.1 auto/voltmeter.py Normal file
View File

@ -0,0 +1,43 @@
class AKIP():
def __init__(self, folder):
self.folder = folder
def getVoltageDC(self):
self.instr = open(self.folder, 'w')
self.instr.write('MEAS:VOLT:DC?\n')
self.instr.flush()
self.instr = open(self.folder, 'r')
data = self.instr.readline()
self.instr.close()
return float(data)
def getCurrentDC(self):
self.instr = open(self.folder, 'w')
self.instr.write('MEAS:AMP:DC?\n')
self.instr.flush()
self.instr = open(self.folder, 'r')
data = self.instr.readline()
self.instr.close()
return float(data)
def getVoltageAC(self):
self.instr = open(self.folder, 'w')
self.instr.write('MEAS:VOLT:AC?\n')
self.instr.flush()
self.instr = open(self.folder, 'r')
data = self.instr.readline()
self.instr.close()
return float(data)
def getCurrentAC(self):
self.instr = open(self.folder, 'w')
self.instr.write('MEAS:AMP:AC?\n')
self.instr.flush()
self.instr = open(self.folder, 'r')
data = self.instr.readline()
self.instr.close()
return float(data)
# for i in range(5):
# print(AKIP('/dev/usbtmc0').getVoltageDC())