Pyvisa使用是德科技发电机超时

时间:2017-05-22 18:27:08

标签: python ethernet pyvisa

我正在尝试回读Keysight发生器在采样期间测量的值,但我不断收到超时错误:

pyvisa.errors.VisaIOError: VI_ERROR_TMO (-1073807339): 
Timeout expired before operation completed.

我能够读取其他数据,例如IDN,所以我不认为这是终止信号的错误,我一直用它来获取我的命令:http://literature.cdn.keysight.com/litweb/pdf/N6705-90001.pdf我正在寻找的部分at是从第162页到第168页。这是我的代码,第一部分获取IDN并读取电压和电流正常,它是测量评论后的部分似乎无法正常工作。提前谢谢。

#request info from keysight power generator
print(keysight.query("*IDN?"))
#set voltage, current and turn on otuput
keysight.write("VOLT 10, (@1)")
keysight.write("CURR 1, (@1)")
keysight.write("OUTP ON,(@1)")
#read current volt and curr
print(keysight.query_ascii_values("MEAS:VOLT? (@1)"))
print(keysight.query_ascii_values("MEAS:CURR? (@1)"))
#sets a limit on current and voltage
keysight.write("CURR:LIM .5, (@1)")
keysight.write("VOLT:LIM 30, (@1)")
#measurments
keysight.write("SENS:FUNC:VOLT ON,(@1)")
keysight.write("SENS:SWE:TINT RES1000,(@1)")
keysight.write("SENS:SWE:POIN 500,(@1)")
keysight.write("SENS:SWE:OFFS:POIN 10,(@1)")
keysight.write("INIT:ACQ (@1)")
time.sleep(1)
keysight.write("TRIG:ACQ (@1)")
time.sleep(1)
keysight.write("VOLT 1, (@1)")
time.sleep(1)
keysight.write("VOLT 2, (@1)")
time.sleep(1)
keysight.write("VOLT 3, (@1)")
time.sleep(1)
keysight.write("VOLT 4, (@1)")
time.sleep(1)
keysight.write("VOLT 5, (@1)")
time.sleep(1)
keysight.write("ABOR:ACQ(@1)")
print(keysight.query_ascii_values("FETC:VOLT:MAX?(@1)"))
time.sleep(.5)

1 个答案:

答案 0 :(得分:0)

原来是间距问题,现在是代码:

    /usr/bin/kafka-console-producer --broker-list Hostname:9092 --topic MyFirstTopic1