我正在尝试连接控制器以进行 python 实验。目前,这是我正在尝试运行的代码
import sys
print('adding location of IOPortClientLib.dll & Newport.CONEXAGP.CommandInterfacedll to sys.path')
sys.path.append(r'C:\Program Files\Newport\Piezo Motion Control\Newport CONEX-AGP Applet\Bin')
import clr
clr.AddReference('Newport.CONEXAGP.CommandInterface.dll')
Run Code Online (Sandbox Code Playgroud)
我得到两个不同的结果:
adding location of IOPortClientLib.dll & Newport.CONEXAGP.CommandInterfacedll to sys.path
Traceback (most recent call last):
File "conex_test.py", line 7, in <module>
clr.AddReference('Newport.CONEXAGP.CommandInterface.dll')
AttributeError: module 'clr' has no attribute 'AddReference'
Run Code Online (Sandbox Code Playgroud)
adding location of IOPortClientLib.dll & Newport.CONEXAGP.CommandInterfacedll to sys.path
Traceback (most recent call last):
File "C:\Users\natal\Box Sync\Downer group (ndf367@eid.utexas.edu)\Sandia\code\python\conex_test.py", line 6, in <module>
import …Run Code Online (Sandbox Code Playgroud)