PSTektronix = "USB0::1689::913::081001126668003045::0::INSTR" rm = visa.ResourceManager() rm.list_resources() PS = rm.open_resource( rm.list_resources()[0]) # choose the proper address for your instrument print('Power supply detected=> ' + PS.query('*IDN?')) # chk communication is established or NOT ps = PSupply(PS) ps.on() ps.setCurr(3) # set current to 3 amp ps.setVolt(0) ps.delay(5) print("voltage=" + ps.measureVolt()) print("Current=" + ps.measureCurr()) ps.setVolt(26) ps.delay(1) print("voltage=" + ps.measureVolt()) print("Current=" + ps.measureCurr()) ps.setVolt(3) ps.delay(.5) print("voltage=" + ps.measureVolt()) print("Current=" + ps.measureCurr()) ps.setVolt(26) ps.delay(5) print("voltage=" + ps.measureVolt())
PS.query('*IDN?')) # chk communication is established or NOT ps = PSupply(PS) maxVoltage = 10 # set max voltage limit minVoltage = 0 # set Min voltage limit delaySec = 2 # set delay time between on and off # turn on Power supply ps.on() # set max current limit ps.setCurr(5) ps.setVolt(9) ps.delay(1) print("Voltage ==> " + ps.measureVolt() + "current ==>" + ps.measureCurr()) ps.delay(5) ps.setVolt(13.5) ps.delay(1) print("Voltage ==> " + ps.measureVolt() + "current ==>" + ps.measureCurr()) ps.delay(5) ps.setVolt(16) ps.delay(1) print("Voltage ==> " + ps.measureVolt() + "current ==>" + ps.measureCurr()) ps.delay(5) ps.off() PS.close() rm.close()
sheet1.write(3, 2, 'Project Name') sheet1.write(3, 8, 'Setup No.') sheet1.write(4, 8, 'Voltage') sheet1.write(5, 8, 'Current') ps.on() ps.setCurr(3) # set current to 3 amp # step 1 => Usmax(16) to Usmin(8) for i in range(1600, 700, -1): # set the range from 9 to 16 V test(i / 100, 1.2) i -= 1 sheet1.write(3, 9, 'Step 1') sheet1.write(4, 9, ps.measureVolt()) sheet1.write(5, 9, ps.measureCurr()) print(ps.measureVolt()) print(ps.measureCurr()) # step 2 => Usmin(8V) to 0V for i in range(800, 1, -1): # set the range from 9 to 16 V test(i / 100, 1.2) i -= 1 print(ps.measureVolt()) print(ps.measureCurr()) # step 3 => 0V to Usmin (8V)
rm = visa.ResourceManager() rm.list_resources() PS = rm.open_resource(rm.list_resources()[0]) # choose the proper address for your instrument print('Power supply detected=> ' + PS.query('*IDN?')) # chk communication is established or NOT ps = PSupply(PS) ps.on() ps.setCurr(3) # set current to 3 amp # step 1 => Usmax(16) to Usmin(9) for i in range(16, 9, -1): # set the range from 16 to 8 V test(i, 60) i -= .5 test(i, 60) print(ps.measureVolt()) print(ps.measureCurr()) # step 2 => Usmin(9V) to 0V for i in range(9, 0, -1): # set the range from 16 to 8 V test(i, 60) i -= .5 test(i, 60) print(ps.measureVolt()) print(ps.measureCurr()) # step 3 => 0V to Usmin (8V) for i in range(0, 9): # set the range from 0 to 8 V test(i, 60) i += .5