使用此代码可以控制常用编程电源,示波器等仪器#coding:utf-8
import visa
class Meas():
def __init__(self):
rm = visa.ResourceManager()
res = rm.list_resources()
for name in res:
if 'TCP' in name:
self.Meas_inst = rm.open_resource(name)
welcome = self.Meas_inst.query("*IDN?")
self.Meas_inst.write("SYSTEM: REMOTE")
print(welcome)
def Meas_on(self):
self.Meas_inst.write("OUTP ON")
评论