英文:
Windows 10 Python pyads library error: Could not find module 'TcAdsDll.dll'
问题
我正在尝试在我的Windows 10计算机上使用pyads库与Beckhoff PLC进行通信。
我已经使用"pip install pyads"安装了该库。我安装的版本是3.3.9。
我正在使用的Python版本是3.8.10。
当我执行"import pyads"时出现以下错误:
import pyads
File "C:\Users\usuSAT026\AppData\Local\Programs\Python\Python38\lib\site-packages\pyads\__init__.py", line 10, in <module>
from .ads import (
File "C:\Users\usuSAT026\AppData\Local\Programs\Python\Python38\lib\site-packages\pyads\ads.py", line 49, in <module>
from .pyads_ex import (
File "C:\Users\usuSAT026\AppData\Local\Programs\Python\Python38\lib\site-packages\pyads\pyads_ex.py", line 69, in <module>
_adsDLL = ctypes.WinDLL("TcAdsDll.dll") # type: ignore
File "C:\Users\usuSAT026\AppData\Local\Programs\Python\Python38\lib\ctypes\__init__.py", line 373, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'TcAdsDll.dll' (or one of its dependencies). Try using the full path with constructor syntax.
我的计算机上没有安装TwinCAT。我在PLC上使用的TwinCAT版本是v3.1.4024.25。
我该怎么办?
谢谢!
英文:
I am trying to use pyads library in my Windows 10 computer to communicate with my Beckhoff PLC.
I have installed the library with "pip install pyads". The version I have installed is 3.3.9.
The version of Python I am using is 3.8.10.
When I do "import pyads" the following error appears:
import pyads
File "C:\Users\usuSAT026\AppData\Local\Programs\Python\Python38\lib\site-packages\pyads\__init__.py", line 10, in <module>
from .ads import (
File "C:\Users\usuSAT026\AppData\Local\Programs\Python\Python38\lib\site-packages\pyads\ads.py", line 49, in <module>
from .pyads_ex import (
File "C:\Users\usuSAT026\AppData\Local\Programs\Python\Python38\lib\site-packages\pyads\pyads_ex.py", line 69, in <module>
_adsDLL = ctypes.WinDLL("TcAdsDll.dll") # type: ignore
File "C:\Users\usuSAT026\AppData\Local\Programs\Python\Python38\lib\ctypes\__init__.py", line 373, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'TcAdsDll.dll' (or one of its dependencies). Try using the full path with constructor syntax.
I don't have TwinCAT installed on my computer. The TwinCAT version I'm using in the PLC is v3.1.4024.25.
What can I do?
Thanks!
答案1
得分: 2
你的电脑上必须安装至少ADS版本的TwinCat才能使pyads正常工作(或者说为了使任何ADS通信正常工作),然后你必须使用路由对话框在电脑和PLC之间创建一条路由。Beckhoff有三个版本的TwinCat,XAE(完整的工程软件),XAR(仅TwinCat运行时)以及用于在不同的TwinCat设备之间路由通信流量的ADS版本。
最新版本可以从Beckhoff网站下载:
https://www.beckhoff.com/en-en/products/automation/twincat/tc1xxx-twincat-3-base/tc1000.html
英文:
You must have at least the ADS version of TwinCat installed on your PC for pyads to work (or for any ADS communication to work for that matter) and you must then create a route between the PC and the PLC using the route dialog. Beckhoff have three versions of Twincat, XAE ( Full engineering SW), XAR (just the twincat runtime) and the ADS version used to route the communication traffic between different twincat devices.
The latest version of this can be downloaded from the beckhoff website here:
https://www.beckhoff.com/en-en/products/automation/twincat/tc1xxx-twincat-3-base/tc1000.html
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论