我正在尝试将IV测量(源电流、感应电压)存储到Keithley2400缓冲区中,并将测量数据(电压和电流)检索到python程序变量“data”中
rm = pyvisa.ResourceManager()
connected_list=rm.list_resources()
print(connected_list) # list[0] is RS-232 reference
Ki2400 = rm.open_resource(connected_list[0])
Ki2400.read_termination = '\r'
Ki2400.timeout=5000
print(Ki2400.query('*IDN?'))
Ki2400.write('*RST')
Ki2400.write(':sens:func:conc off')
Ki2400.write(':sour:func current')
Ki2400.write(":sens:func 'volt:dc'")
Ki2400.write(':SENS:VOLT:NPLC 0.01')
Ki2400.write(':sens:volt:prot 30')
Ki2400.write(':source:current:start 1e-12')
Ki2400.write(':source:current:stop 100e-3')
#Ki2400.write(':source:current:step 4e-4')
Ki2400.write(':source:sweep:points 500')
Ki2400.write(':source:current:mode sweep')
Ki2400.write(':sour:swe:rang auto')
Ki2400.write(':sour:swe:spac log')
Ki2400.write(':trig:coun 500')
Ki2400.write(':sour:del 0.1')
Ki2400.write('output on')
Ki2400.write('read?')
data=Ki2400.read()
Ki2400.write(':outp off')
但是,这会产生以下错误:
VisaIOError: VI_ERROR_ASRL_OVERRUN (-1073807252): An overrun error occurred during transfer. A character was not read from the hardware before the next character arrived.
我不确定是否对缓冲区中的存储进行编码并正确读取。任何帮助都将不胜感激
我试图查找错误,并且能够在National Instruments' website上找到一些线程,似乎您的缓冲区太小或者读取速度不够快This thread from GitHub详细介绍了一些可以用来增加缓冲区大小的方法,因此您可能需要:
在代码的顶部。或者你也可以改变
进入
因为这可能会读得稍微快一点
相关问题 更多 >
编程相关推荐