“Windows 10 Python pyads library error: Could not find module ‘TcAdsDll.dll'”

huangapple go评论59阅读模式
英文:

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 &quot;C:\Users\usuSAT026\AppData\Local\Programs\Python\Python38\lib\site-packages\pyads\__init__.py&quot;, line 10, in &lt;module&gt;
    from .ads import (
  File &quot;C:\Users\usuSAT026\AppData\Local\Programs\Python\Python38\lib\site-packages\pyads\ads.py&quot;, line 49, in &lt;module&gt;
    from .pyads_ex import (
  File &quot;C:\Users\usuSAT026\AppData\Local\Programs\Python\Python38\lib\site-packages\pyads\pyads_ex.py&quot;, line 69, in &lt;module&gt;
    _adsDLL = ctypes.WinDLL(&quot;TcAdsDll.dll&quot;)  # type: ignore
  File &quot;C:\Users\usuSAT026\AppData\Local\Programs\Python\Python38\lib\ctypes\__init__.py&quot;, line 373, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module &#39;TcAdsDll.dll&#39; (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

huangapple
  • 本文由 发表于 2023年5月22日 18:17:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/76305160.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定