from win32com import client
import time

s = client.Dispatch('{82423ECF-EFC0-47E0-8AB0-35ADE2CD3EEF}')
#寻找设备
print(s.FindDevice())

#打印序列号
if s.DeviceIsOpen():
	print(s.GetSerialNumber())
else:
	sys.exit()
time.sleep(1)
#读取开路电位
print(s.GetOcpValue())
#测试方法参数设置  以下为等待3s 起始0.5V 终止0.1V 电位增量0.004V  振幅0.05V  脉冲宽度0.05s  脉冲周期0.5s  采样宽度10ms
s.SetDPVParams(3,0.5,0.1,0.004,0.05,0.05,0.5,10)
time.sleep(1)
s.DeviceStart()

#读取返回的数据量和数据值
while s.ExpIsEnd()==False:
	print(s.GetValuesCount())
	print(s.GetLastValue())
	time.sleep(1)
#测量结束
print(s.GetValuesCount())
print(s.GetLastValue())

#断开
s.DeviceDisconnect()