Beckhoff 协议,用于与 TwinCAT 设备通信。
This library is intended to provide easy use as ADS client applications running on non-windows systems (e.g. FreeBSD, Linux, ...) to communicate with TwinCAT devices via TCP/IP.
To build this library a recent compiler with C++14 support is required.
| host os | host | target | compiler |
|---|---|---|---|
| Alpine 3.24 | amd64 | amd64 | gcc 15.2.0 |
| Arch Linux | amd64 | amd64 | clang 22.1.6 |
| Arch Linux | amd64 | amd64 | gcc 16.1.1 |
| Debian 13 | amd64 | amd64 | clang 19.1.7 |
| Debian 13 | amd64 | amd64 | gcc 14.2.0-19 |
| Debian 13 | amd64 | i686 | gcc 14.2.0-19 |
| Debian 13 | amd64 | mips | gcc 14.2.0-19 |
| Debian 12 | amd64 | win32 | gcc 10.2.1-6 |
| Debian 13 | amd64 | riscv64 | gcc 14.2.0-19 |
| Debian 13 | arm64 | arm64 | gcc 14.2.0-19 |
| TC/BSD 14 | amd64 | amd64 | clang 19.1.7 |
# clone the repository
git clone https://github.com/Beckhoff/ADS.git
# change into root of the cloned repository
cd ADS
# configure meson to build the library into "build" dir
meson setup build
# let ninja build the library
ninja -C buildTwinCAT Engineering: Go to the tree item SYSTEM/Routes and add a static route.
TwinCAT Systray: Open the context menue by right click the TwinCAT systray icon. (not available on Windows CE devices)
TC2: Go to Properties/AMS Router/Remote Computers and restart TwinCAT
TC3: Go to Router/Edit routes.
TcAmsRemoteMgr:
Windows CE devices can be configured locally (TC2 requires a TwinCAT restart). Tool location: /Hard Disk/System/TcAmsRemoteMgr.exe
IPC Diagnose: Beckhoff IPC’s provide a web interface for diagnose and configuration. Further information: http://infosys.beckhoff.de/content/1033/devicemanager/index.html
Sample AMS route:
Name: MyAdsClient
AMS Net Id: 192.168.0.1.1.1 # NetId of your ADS client, derived from its IP address or set by bhf::ads:SetLocalAdress().
Address: 192.168.0.1 # Use the IP of the ADS client, which is connected to your TwinCAT target
Transport Type: TCP/IP
Remote Route: None / Server
Unidirectional: false
Secure ADS: falseUse this option for system with no TwinCAT 3.1 installtion:
# configure meson to build example into "build" dir
meson example/build example
# let ninja build the example
ninja -C example/build
# and run the example
./example/build/example# Install toolchain
doas install os-generic-userland-devtools
# configure meson to build example into "build" dir
meson example/build example --native-file meson.native.tcbsd
# let ninja build the example
ninja -C example/build
# and run the example
./example/build/example# configure meson to build example into "build" dir
meson example/build example --native-file meson.native.tclur
# let ninja build the example
ninja -C example/build
# and run the example
./example/build/exampleNote: the name of the binaries which use the TwinCAT ADS Router have a different naming scheme
| binary | standalone | use TwinCAT Router |
|---|---|---|
| AdsLib | x | |
| TcAdsLib | x | |
| adstool | x | |
| tcadstool | x | |
| example | x | |
| tcexample | x |
We build, test and ship this library with meson. All the instructions above use it, and it is the build system our CI covers across Linux, TC/BSD and the cross compiled targets.
If you maintain a CMake project and want to use AdsLib, our first suggestion is to move that project to meson.
If that is not an option, the repository does ship a CMakeLists.txt for exactly this case. It is a community effort, not a supported second build system: it covers fewer platforms, our CI only exercises it on Linux and it may lag behind the meson build. Most of its changes come from outside contributors.
# On Windows with TwinCAT installed, from the root of the repository
mkdir build && cd build
# TcAdsDll_ROOT is only needed if the ADS API is installed somewhere
# other than the default location
cmake -DTcAdsDll_ROOT="$env:TWINCAT_ADS_API_ROOT" ..
cmake --build . --config Release --parallelADS/AMS Specification: https://infosys.beckhoff.com/content/1033/tc3_ads_intro/index.html
暂无开放 Issues,或尚未同步最近议题。