我有一个 Keithley 2701 DMM,我正在尝试使用 python 2.7 和 pyVISA 通过 TCPIP 与它通信。我正在使用 virtualenv 和 wxPython 运行 python 2.7。我知道设备处于活动状态,因为我可以 ping IP 地址,我正在尝试使用以下代码访问机器:
from pyvisa.vpp43 import visa_library
visa_library.load_library("/Library/Frameworks/Visa.framework/VISA")
import visa import instrument
Keithley = visa.instrument("TCPIP::192.168.0.2::INSTR")
当我运行代码时,出现以下错误:
Traceback (most recent call last):
File "Keithley.py", line 4, in <module>
Keithley = visa.instrument("TCPIP::192.168.0.2::INSTR")
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyVISA-1.4-py2.7.egg/pyvisa/visa.py", line 294, in instrument
return Instrument(resource_name, **keyw)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyVISA-1.4-py2.7.egg/pyvisa/visa.py", line 358, in __init__
"lock")))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyVISA-1.4-py2.7.egg/pyvisa/visa.py", line 132, in __init__
keyw.get("lock", VI_NO_LOCK))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyVISA-1.4-py2.7.egg/pyvisa/vpp43.py", line 753, in open
byref(vi))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyVISA-1.4-py2.7.egg/pyvisa/vpp43.py", line 398, in check_status
raise visa_exceptions.VisaIOError, status
pyvisa.visa_exceptions.VisaIOError: VI_ERROR_RSRC_NFOUND: Insufficient location information or the requested device or resource is not present in the system.
任何帮助将不胜感激....
五