""
Hardware Keithley Universal meter and programmable power supply
Visa is a set of standards developed by the Vxiplug&play System Alliance.
Python implements visa to form the Pyviva module
‘‘‘
## #IV测试系统的部分程序代码 fromVisaImport* fromStringImport* fromMathImport*classCurrentmiter (instrument): CurrentValue=[] datapoints=1ATRR="" def __init__(self,delaytime=0.2,dps=111): self=instrument ("gpib::23") Self.timeout=30datapoints=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 (":D ata:clear") Self.write (":d ata:points%d"%datapoints) Self.write (":d Ata:feed:control Next") Self.write (":d ata: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") defNewask (self,cmd):returnself.ask_for_values (cmd)classSourcegenerator (instrument): Vrangeselect=""Vstart=1Vstop=0 VStep=1Timestep=1def __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)) +1K2000=currentmiter (0.2, Points) self.write ("E") Self.write ("*cls ISE1 *sre8 S0") Self.write ("*TRG") Self.wait_for_srq ()##主程序 fromIvkeithleyImport* fromIvsourceImport* fromVisaImport*if __name__="__main__": Keithley=currentmiter (0.1,10) Source=sourcegenerator (0.2) Source.starttest () Source.write ("*TRG") #source.write ("H")
PV cell Measurement and control system Python code