光伏電池測控系統python代碼
阿新 • • 發佈:2017-11-27
rst stop 程序代碼 標準 col auto clas res bsp
‘‘‘
硬件keithley萬用表和程控電源
visa是VXIplug&play系統聯盟制定的一套標準。
python實現VISA,形成pyviva模塊
‘‘‘
###IV測試系統的部分程序代碼 from visa import * from string import * from math import * class CurrentMiter(Instrument): CurrentValue=[] datapoints=1 Atrr="" def __init__(self,DelayTime=0.2,DPs=111): self=instrument("GPIB::23") self.timeout=30 datapoints=DPs self.delay=DelayTime self.write("*Rst") self.write(":SYST:PRES") self.write(":FORM:DATA ASCII") self.write(":TRIgger:delay 0") self.write(":trigger:source external") self.write(":INITiate:CONTinuous On") self.write(":trigger:count 1") self.write(":Data:clear") self.write(":data:points %d" % datapoints) self.write(":data:feed:control next") self.write(":data:feed sense") self.write(":FUNC ‘CURRent:DC‘") self.write(":CURRent:DC:RANGe:Auto 1") self.write(":CURRent:DC:DIGits 7") self.write(":CURRent:DC:AVERage:STATe off") def newAsk(self,cmd): return self.ask_for_values(cmd) class SourceGenerator(Instrument): VRangeSelect="" VStart=1 VStop=0 VStep=1 TimeStep=1 def __init__(self,DelayTime=0.2,V0=1.0,Vt=-0.1,Vs=0.01,Ts=0.1,Vr=4): 146 self=instrument("GPIB::1") self.delay=DelayTime self.VRangeSelect=Vr self.VStart=V0 self.VStop=Vt self.VStep=Vs self.TimeStep=Ts self.write("C") self.write("RP1") self.write("PM2") self.write("V%s" % str(self.VRangeSelect)) cmd="SP"+str(self.TimeStep)+"SN"+str(self.VStart)+","+str(self.VStop)+","+str(self.VStep)+ " ST0" self.write(cmd) Points=abs((self.VStop - self.VStart)/ (self.VStep))+1 K2000=CurrentMiter(0.2,Points) self.write("E") self.write("*CLS ISE1 *SRE8 S0") self.write("*TRG") self.wait_for_srq() ##主程序 from IVKeithley import * from IVSource import * from visa import * if __name__ ="__main__": Keithley=CurrentMiter(0.1,10) Source=SourceGenerator(0.2) Source.StartTest() Source.write("*TRG") #Source.write("H")
光伏電池測控系統python代碼