Beckhoff TwinCAT/ADS
ADS (Automation Device Specification) is the communication protocol used by the TwinCAT runtime from Germany's Beckhoff. It is mainly used in industrial PC (IPC) and EtherCAT master environments running TwinCAT 2 / 3.
If you are dealing with a PC-based control environment — automotive lines, semiconductor, wind power, motion control — it is almost certainly ADS.
Registration form entries
| Field | What to enter | Example |
|---|---|---|
| IP address | IP of the IPC running TwinCAT | 192.168.0.80 |
| Port | ADS TCP port | 48898 (standard / changing not recommended) |
| Target AMS NetId (target-netid) | AMS NetId of the target IPC — leave empty for automatic IP주소.1.1 | 192.168.0.80.1.1 |
| Target AMS port (target-port) | TwinCAT runtime port | 851 (TwinCAT 3 PLC) / 801 (TwinCAT 2 PLC1) |
Other options: source-netid / source-port (AMS identifier on the gateway side — default 32905),
connect-timeout / read-timeout (ms, default 3000). The old option key notation
(ams-net-id / ams-port / target-ams-net-id / timeout-request) has been deprecated.
AmsNetId format
Six octets in the form a.b.c.d.1.1. It is usually the IPC's IP address with .1.1 appended, but the NetId shown in TwinCAT System Manager is authoritative. Find it via the TwinCAT icon in the system tray → Properties → AMS NetId.
Route registration (required)
ADS requires both sides to know each other's NetId. When the gateway first calls the PLC, an Add Route Dialog appears on the PLC side, or the request is rejected automatically. In TwinCAT System Manager → Routes → Add, add the gateway IP / NetId, and verify that the TwinCAT license is valid.
With TwinCAT 3, ADS responses stop once the 30-day trial expires. Check the license status in License Manager first.
PLC address notation for tags
ADS supports two access methods.
1. Direct memory area (Indexed)
| Notation | Meaning |
|---|---|
M0:4 | Memory area (M%) offset 0, 4 bytes |
I0:2 | Input area offset 0, 2 bytes |
Q0:2 | Output area offset 0, 2 bytes |
Format is <area>:<offset>:<size>. size is in bytes.
2. Symbolic
| Notation | Meaning |
|---|---|
MAIN.fCounter | The fCounter variable in the MAIN program |
MAIN.fCounter:REAL | Explicit data type (32-bit float) |
GVL.bRunning:BOOL | bRunning in the Global Variable List |
Symbolic notation requires that the PLC side has a TPY (TwinCAT 2) or a symbol download (TwinCAT 3 → Build → Activate Configuration).
Data type matching
| PLC value | Data type | Type modifier | PLC address example |
|---|---|---|---|
| BOOL | Boolean | (empty) | GVL.bRunning:BOOL |
| BYTE / SINT | Integer | B | MAIN.bByte:BYTE |
| INT (16-bit) | Integer | (empty) | MAIN.nCount:INT |
| DINT (32-bit) | Integer | DW | MAIN.nTotal:DINT |
| REAL (32-bit float) | Float | REAL | MAIN.fTemp:REAL |
| LREAL (64-bit float) | Double | LREAL | MAIN.fPos:LREAL |
| STRING(80) | String | STR[80] | MAIN.sName:STRING |
Common problems and fixes
| Symptom / message | Possible cause | Fix |
|---|---|---|
| "No route to host" | Route not registered | Add the gateway in TwinCAT System Manager → Routes |
| "Target port not found" | AmsPort does not match the series | Re-check TC2 = 801, TC3 = 851 |
| "Symbol not found" | Symbol download not performed | Run Activate Configuration in TwinCAT 3 and retry |
| All values 0 | TwinCAT is in STOP / CONFIG mode instead of RUN | Switch to RUN in System Manager |
| License error | Trial expired | Renew the license in License Manager |
Frequently used examples
| Tag name | PLC address | Data type | Type modifier |
|---|---|---|---|
| Running flag | GVL.bRunning:BOOL | Boolean | (empty) |
| Counter | MAIN.nCount:DINT | Integer | DW |
| Temperature | MAIN.fTemp:REAL | Float | REAL |
| Batch name | MAIN.sBatch:STRING | String | STR[80] |
More detailed examples / automated registration
See the ADS examples in Advanced — REST API.