On this page
Beckhoff ADS
This plugin reads and writes TwinCAT variables by symbol, memory area, or explicit ADS index-group address. It is named Beckhoff ADS in the device selector.
See Collection Configuration for common channel, device, variable, and data-format settings. This page covers only AMS/ADS routing, addresses, and debug.
Compatible devices and models
| Device series / model examples | Connection requirements |
|---|---|
| Beckhoff controllers or industrial PCs running a TwinCAT 2/3 PLC runtime | The target must run ADS and have an ADS route to the gateway. Match AMS Net ID, PLC runtime port and symbol access permissions. An Ethernet-equipped controller does not necessarily have a running PLC runtime. |
Prepare the TwinCAT target
This example uses gateway IP 192.168.1.10, PLC IP 192.168.1.40, and the first TwinCAT 3 PLC Runtime. Connect their Ethernet interfaces, configure reachable IP networks, download the PLC project and start the required Runtime before collecting program variables.
Keep these three addresses separate:
| Item | Example | Where to obtain it |
|---|---|---|
| PLC TCP endpoint | 192.168.1.40:48898 | PLC interface IP and ADS/TCP listening port. Enter this in the channel’s remote address. |
| PLC AMS Net ID | 192.168.1.40.1.1 | TwinCAT target information or route list. Read the actual six-part ID rather than deriving it from the IP. |
| PLC Runtime ADS port | 851 | Selected Runtime. The first TwinCAT 3 PLC Runtime commonly uses 851; the first TwinCAT 2 PLC Runtime commonly uses 801. Other Runtimes have their own ports. |
Add the gateway route on the PLC
On the PLC system, open the TwinCAT tray menu Router → Edit Routes, or connect to the target and add a static route under SYSTEM → Routes. Register the gateway’s AMS Net ID and reachable IP. A route created only from the engineering PC to the PLC does not register the gateway as a client.
| TwinCAT route field | Example and purpose |
|---|---|
| Route Name | For example TGateway, to identify the client. |
| AmsNetId | 192.168.1.10.1.1, exactly matching the gateway’s Source AMS Net ID. Each of the six parts is 0–255. |
| Transport Type | TCP_IP. |
| Address Info / IP Address | 192.168.1.10, the gateway interface reachable from the PLC. Select the correct interface on a multihomed gateway. |
| Target Route | Static retains this system’s route after restarting; Temporary lasts until restart. |
| Remote Route | For the standalone ADS client, use None / Server as in Beckhoff’s client example. The gateway does not require a TwinCAT Router installation. |
| Unidirectional | Leave unchecked for the ordinary request/response route. |
The official TwinCAT 3 Add Route window below identifies these fields. Its names and addresses are vendor examples; enter your own client information from the table above.

When adding a route remotely from an engineering PC, supply an account permitted to manage the target’s routes, then inspect the resulting route on the PLC.

This plugin connects to ordinary ADS/TCP endpoints. Secure ADS is a separate protocol capability; the channel’s SSL switch does not convert ordinary ADS into Secure ADS. Determine a suitable connection scheme for targets that accept only Secure ADS. See Beckhoff’s Add Route reference and standalone ADS client example .
Configure the gateway channel and device
- Open Development Configuration → Collection Configuration. Create channel
Collect_BeckhoffADS_TCP, chooseTcpClient, and set the remote address to192.168.1.40:48898. Normally leave the bind address empty; use a gateway interface address when a specific outgoing interface is required. Keep maximum concurrency at1. The ADS logical port851does not belong in the TCP endpoint.

- Create a device using Beckhoff ADS, select this channel, and use an execution interval such as
1000ms. Finish the route and variable configuration before enabling the channel and device.

- Open Plugin Properties and enter both AMS identities and logical ports. They are not inferred from the channel IP.
| Property | Configuration and behavior |
|---|---|
| Source AMS Net ID | Gateway client ID, for example 192.168.1.10.1.1. Match the client ID registered in the PLC route. Initially empty. Recheck the route after changing the gateway interface or IP. |
| Source ADS port | Gateway logical port, 1–65535; this example uses 32905. It identifies the sender and is separate from TCP. Replace the initial 0 with a valid value. |
| Target AMS Net ID | Actual PLC ID, for example 192.168.1.40.1.1. Initially empty. A valid TCP connection cannot compensate for an incorrect target ID. |
| Target ADS port | Runtime logical port, 1–65535; use 851 for this example. Replace the initial 0 with the actual PLC Runtime port, not a router or another ADS service port. |
| Maximum pack size | Default 1024 data bytes. Limits combined reads of contiguous index addresses in the same collection group; symbols are read separately. Check valid memory ranges and separate groups before increasing it. |
| Data format | Default DCBA, the usual ADS little-endian numeric layout. Map REAL to Float and LREAL to Double; byte swapping cannot correct the wrong data type. |
| Reverse string byte/word | Off by default. Leave off for ordinary TwinCAT ASCII strings; enable only for source storage that swaps character bytes within words. |
| Read/write timeout | Default 3000 ms per request. Correct route and Runtime errors before increasing it. |
| Send delay | Default 0 ms before transmitting. Increase only when the target requires slower requests. |
| Retry count | Default 3. Retries lengthen the time spent on a failed request and affect the effective scan interval. |
| Duty cycle / write priority | Defaults 3 and off. The former schedules a read after consecutive writes; the latter cancels an active read when writing. Keep defaults for read-only collection; see Collection Configuration for write-heavy workloads. |

Map TwinCAT variables to gateway addresses
Symbol addresses
Prepare observable variables in TwinCAT’s MAIN program, build and download the project, start the Runtime, and inspect the online values:
PROGRAM MAIN
VAR
TestWord : INT := 1234;
TestReady : BOOL := TRUE;
TestArray : ARRAY[0..2] OF INT := [1234, 5678, 90];
TestText : STRING(20) := 'ADS-DEMO';
END_VARCreate gateway variable TestWord with address s=MAIN.TestWord, type Int16, array length 1, and initially read-only permission. Include MAIN. in the symbol path. IEC INT is a 16-bit signed value.

In Field Editor, select Symbol, enable Symbol name, enter MAIN.TestWord, leave Null unchecked, and apply the address. The s= prefix denotes a symbol rather than a station number.

| TwinCAT declaration | Gateway address, type and length | Value represented |
|---|---|---|
TestWord : INT | s=MAIN.TestWord, Int16, 1 | One signed 16-bit value, 1234 in the example. |
TestReady : BOOL | s=MAIN.TestReady, Boolean, 1 | One Boolean, true in the example. Do not append .0 to the symbol. |
TestArray : ARRAY[0..2] OF INT | s=MAIN.TestArray, Int16, 3 | Three elements [1234,5678,90]. Length counts elements. |
TestText : STRING(20) | s=MAIN.TestText;len=21;encoding=ASCII, String, 1 | Storage for up to 20 single-byte characters plus the terminating zero byte; the example text is ADS-DEMO. |
Use the full path from the downloaded project. Global variable lists, function-block instances and different Runtimes can have different paths. For other encodings, WSTRING, or structures, determine the actual byte layout instead of copying the 21-byte STRING(20) example. Field Editor conversion overrides—byte order, encoding, string byte length, BCD and variable-length strings—apply only to that variable; unchecked overrides retain the device/type defaults.
Memory bytes and bits
For an established PLC memory map, select Absolute, choose M, I, or Q, and enter a byte offset. An INT located at memory byte 100 uses M100, Int16, length 1, consuming bytes 100 and 101. The next adjacent INT begins at M102.

| Address | Meaning |
|---|---|
M100 / I100 / Q100, non-Boolean | Byte100 of memory, input image, or output image. Type size and element count determine the read length. |
M100.3, Boolean, length 1 | Bit 3 of byte 100; bit range 0–7. The bit field is shown only for Boolean. |
M100, Boolean | Starts at bit 0 of byte 100. Select Byte to read the whole byte as a number. |
M100.3, Boolean, length 3 | Three consecutive Boolean values starting at bit 3, rather than three numeric bytes. |
Absolute offsets are decimal. Non-Boolean addresses cannot include a bit suffix. Treat the input image as read-only observation; the PLC program and device state can overwrite output-image writes.
Explicit index group and offset
Select Explicit when the point list provides ADS IndexGroup and IndexOffset. Raw addresses accept decimal values or 0x hexadecimal values. The numerical fields use values such as group 16416 (0x4020) and offset 100, producing ig=0x4020;io=100.

| Area | Byte group / offset | Bit group / offset |
|---|---|---|
| M memory | 0x4020, byte offset | 0x4021, absolute bit offset |
| I input image | 0xF020, byte offset | 0xF021, absolute bit offset |
| Q output image | 0xF030, byte offset | 0xF031, absolute bit offset |
Thus a byte-based M100 read can use ig=0x4020;io=100. Boolean M100.3 can use ig=0x4021;io=803 (100×8+3). Supply both ig and io; do not mix them with s= or an absolute address. Both fields are unsigned 32-bit numbers; the PLC determines the accessible range of each index group.
Read and troubleshoot
Enable the channel, device and variable, then compare s=MAIN.TestWord in Real-time Variables or Details with the TwinCAT online value 1234. Check Boolean, array and string values individually against their declarations. For a manual read, open Protocol Debug → Read/Write and enter the same address, type and length. Messages shows requests and ADS return codes. Ordinary variables do not require an additional special method.
| Symptom | What to check |
|---|---|
| TCP connection fails | Remote endpoint, listening TCP port 48898, firewall and PLC interface. |
| TCP connects but ADS times out or routing fails | Gateway IP/source Net ID registered on the PLC, target Net ID and actual Runtime port. Changing the channel IP does not update AMS identities. |
| Symbol lookup fails | Full path, case, selected Runtime, download status, and whether the symbol still exists and is accessible. |
| Wrong value or response length | INT→Int16, DINT→Int32, REAL→Float, LREAL→Double; array count, string storage bytes and DCBA. |
| Absolute address is outside the valid range | Byte/bit offset, actual memory map and inaccessible gaps crossed by a packed read. |
| A written value immediately changes back | PLC logic may assign it every scan. Check program ownership and write permission before selecting a writable point. |
See Collection Configuration for expression chains, RPC writes, initial values, collection groups and alarms. These settings do not create TwinCAT variables or ADS routes.