0

I'am going to communicate EtherCAT master(CX2020) with Linux OS PC(ubuntu) for storing value from PLC on server and writing also.

By EthearCAT network protcol, it should be availave to communicate with windows plc installed twincat.

But I couldn't find the way for Linux.

Is there any solution?

4

1 回答 1

2

您可以通过多种方式从 Linux 与 CX2020 进行通信,这完全取决于您的要求和用途。

在对此一无所知的情况下,一种选择是使用Beckhoff ADS 协议。默认情况下,所有 Beckhoff PLC 上都安装了 ADS,您可以(使用正确的 ADS 凭据设置)与 ADS 库进行通信。ADS 的好处是它是开源的,因此可以获得 Linux 的代码。

ADS 源代码位于: https ://github.com/Beckhoff/ADS

您基本上需要:
1. 在您的 Linux 机器上编译/安装库
2. 为您的 CX2020 创建一个 ADS/AMS 路由
3. 创建一个使用此路由与 PLC 通信的程序 使用 ADS,您可以直接访问变量在 CX2020 内存中(可读写!)。

有许多可用于所有常见编程语言的成品包装器库,您可以直接在 Linux 中使用它们。如果您使用 Python,我建议您查看 PyADS ( https://github.com/stlehmann/pyads ),它拥有良好的用户群和网络上的许多示例。

于 2018-01-30T09:47:15.967 回答