Beckhoff ADS — AMS Net ID, ports and routes
ADS (Automation Device Specification) in TwinCAT: AMS Net ID and port addressing, routes, TCP 48898, symbolic vs index group/offset access and typical connection problems.
ADS (Automation Device Specification) is the communication interface of Beckhoff TwinCAT. Engineering, HMIs, SCADA drivers, other TwinCAT systems and user programs (C#, Python, Node.js…) use ADS to read and write PLC variables and to call services.
Addressing: AMS Net ID + port
- Every TwinCAT device has an AMS Net ID that looks like an IP address with two extra bytes, e.g.
5.12.34.56.1.1. By default it is derived from an IP address, but it is not an IP address and is set independently. - Each ADS device inside the runtime has a port: TwinCAT 3 PLC runtime 1 = 851 (852, 853… for further runtimes), TwinCAT 2 PLC = 801, system service = 10000.
- On the network ADS/AMS travels over TCP 48898 (and UDP 48899 for discovery/route requests).
Routes
A client and the target must know each other: a route on the target lists the client's AMS Net ID and IP address (and vice versa for TwinCAT-to-TwinCAT). Without a matching route the connection is refused even if the IP network works. Routes are added in TwinCAT XAE ("Add Route"), via the static routes file or by the client library with credentials.
Access methods
| Method | Use |
|---|---|
Symbolic access (MAIN.nSpeed) | Readable, survives recompilation — preferred |
| Index group / index offset | Raw access to memory areas; fast, but offsets change when the program changes |
| Sum commands | Read/write many variables in one request |
| ADS notifications | Server pushes changes cyclically or on change — avoid polling hundreds of tags |
Troubleshooting checklist
- Ping the IP; check firewall for TCP 48898.
- Check AMS Net ID and port (851 vs 801).
- Check the route on both sides; Net IDs must be unique in the system.
- TwinCAT in Run mode? (Config mode → PLC port not available.)
- Variable names with the full path (
MAIN.,GVL.) and matching data types.
Connections
Open in Knowledge Graph →Loading the map…
Sources
- ADS introduction — TwinCAT 3 — Beckhoff
- Service Name and Transport Protocol Port Number Registry — IANA
- Tc2_Standard library — Beckhoff
Updated 2026-10-04