【问题标题】:Python for Keithley吉时利的 Python
【发布时间】:2013-07-13 12:47:44
【问题描述】:

我连接了 Keithley 2701 DMM,安装了软件并正确设置了 IP。我可以通过 Internet Explorer 网页和 Keithley 通讯器访问和控制仪器。当我尝试使用 python 时,它会检测到仪器 即a=visa.instrument("COM1") 不会给出错误。

我也可以给仪器写信:

a.write("*RST")
a.write("DISP:ENAB ON/OFF")
a.write("DISP:TEXT:STAT ON/OFF") 

等都没有给出任何错误,但在仪器屏幕上看不到任何变化。 但是,当我尝试回读时,a.ask("*IDN?") 等给我一个错误 说在操作完成之前超时已过期。

我尝试重新定义为:

a=visa.instrument("COM1",timeout=None)
a=visa.instrument("TCPIP::<the IP adress>::1354::SOCKET")

还有其他一些可能的组合,但我遇到了同样的错误。

请帮忙。

【问题讨论】:

    标签: python python-2.7 ethernet digital analog-digital-converter


    【解决方案1】:

    与 2701 通信的问题可能是无效的终止字符。默认情况下,终止字符的值为CR+LF,即“\r\n”

    设置终止符的python代码是:

    theInstrument = visa.instrument(“TCPIP::<IPaddress>::1394::SOCKET”, term_chars = “\n”) 
    

    theInstrument = visa.instrument(“TCPIP::<IPaddress>::1394::SOCKET”)
    theInstrument.term_chars = “\n”
    

    希望对你有帮助,

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多