Skip to main content

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

FieldWhat to enterExample
IP addressIP of the IPC running TwinCAT192.168.0.80
PortADS TCP port48898 (standard / changing not recommended)
Target AMS NetId (target-netid)AMS NetId of the target IPC — leave empty for automatic IP주소.1.1192.168.0.80.1.1
Target AMS port (target-port)TwinCAT runtime port851 (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 → RoutesAdd, add the gateway IP / NetId, and verify that the TwinCAT license is valid.

Communication refused when the license expires

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)

NotationMeaning
M0:4Memory area (M%) offset 0, 4 bytes
I0:2Input area offset 0, 2 bytes
Q0:2Output area offset 0, 2 bytes

Format is <area>:<offset>:<size>. size is in bytes.

2. Symbolic

NotationMeaning
MAIN.fCounterThe fCounter variable in the MAIN program
MAIN.fCounter:REALExplicit data type (32-bit float)
GVL.bRunning:BOOLbRunning 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 valueData typeType modifierPLC address example
BOOLBoolean(empty)GVL.bRunning:BOOL
BYTE / SINTIntegerBMAIN.bByte:BYTE
INT (16-bit)Integer(empty)MAIN.nCount:INT
DINT (32-bit)IntegerDWMAIN.nTotal:DINT
REAL (32-bit float)FloatREALMAIN.fTemp:REAL
LREAL (64-bit float)DoubleLREALMAIN.fPos:LREAL
STRING(80)StringSTR[80]MAIN.sName:STRING

Common problems and fixes

Symptom / messagePossible causeFix
"No route to host"Route not registeredAdd the gateway in TwinCAT System Manager → Routes
"Target port not found"AmsPort does not match the seriesRe-check TC2 = 801, TC3 = 851
"Symbol not found"Symbol download not performedRun Activate Configuration in TwinCAT 3 and retry
All values 0TwinCAT is in STOP / CONFIG mode instead of RUNSwitch to RUN in System Manager
License errorTrial expiredRenew the license in License Manager

Frequently used examples

Tag namePLC addressData typeType modifier
Running flagGVL.bRunning:BOOLBoolean(empty)
CounterMAIN.nCount:DINTIntegerDW
TemperatureMAIN.fTemp:REALFloatREAL
Batch nameMAIN.sBatch:STRINGStringSTR[80]

More detailed examples / automated registration

See the ADS examples in Advanced — REST API.