Skip to main content

General

Connect Beckhoff ADS

Reference guide for Beckhoff TwinCAT communication via ADS (Automation Device Specification).

Proxus connects to Beckhoff TwinCAT controllers using the native ADS (Automation Device Specification) protocol.

Connection Parameters

Basic Settings

ParameterTypeRequiredDefaultDescription
HoststringYes-PLC IP Address
PortintNo851AMS Port (TwinCAT 3 Runtime 1)
PollingIntervalintNo1000Read cycle interval in milliseconds
ConnectTimeoutintNo3000Connection timeout (ms)

Optimization & Behavior

ParameterTypeDefaultDescription
UseTagCachebooltrueCaches tag handles to improve read/write performance. Disable only if tags change dynamically at runtime.
UseAutoAmsNetidbooltrueAutomatically formats the AMS Net ID as IP.1.1. Set to false if using custom routing.

Advanced Routing

In complex network topologies (e.g., NAT, Docker containers) or when automatic route discovery fails, you may need to explicitly define the AMS Net IDs.

ParameterExampleDescription
SetTargetAMSNetId5.12.82.20.1.1:851The full AMS Net ID + Port of the PLC runtime.
SetSenderAMSNetId192.168.1.50.1.1:35000The AMS Net ID Proxus should use to identify itself to the PLC.
lightbulb
Sender ID

The Sender AMS Net ID must match the IP address of the Proxus Gateway + .1.1 suffix (usually) and must be whitelisted in the TwinCAT Static Routes table on the PLC side.

AMS Port Defaults

The Port parameter corresponds to the AMS Port of the target runtime:

SystemRuntimeDefault Port
TwinCAT 3Runtime 1 (PLC)851
TwinCAT 3Runtime 2 (PLC)852
TwinCAT 2Runtime 1 (PLC)801
TwinCAT 2Runtime 2 (PLC)811
TwinCAT 2Runtime 3 (PLC)821
TwinCAT 2Runtime 4 (PLC)831
warning
ADS Routing

Before connecting, you must add a static route between the Proxus Server and the Beckhoff PLC.

  1. Open TwinCAT Static Routes on the PLC.
  2. Add the IP address of the Proxus Server.
  3. Set the AMS Net ID of the Proxus Server (usually ProxusIP.1.1).

Address Syntax

Proxus supports multiple addressing methods for ADS.

The easiest way to read data is using the full symbolic name of the variable.

Format: {Scope}.{Variable}

LocationExampleDescription
Global VariableGVL.MyCountVariable in a GVL named "GVL"
Main ProgramMAIN.bStartVariable in "MAIN" PRG
Struct MemberMAIN.stConfig.fSpeedNested structure member
Array ElementMAIN.arrData[5]Array index

2. Index Group / Offset (Direct)

For absolute memory access or special system services.

Format: I:{IndexGroup}:{IndexOffset}

AddressDescription
I:0xF020:0Read from IndexGroup 0xF020, Offset 0
I:61472:0Same as above (Decimal: 0xF020 = 61472)

3. Memory Area (TwinCAT 2 Style)

Legacy memory area access.

Format: {Area}:{Offset}

AreaPrefixDescriptionExample
InputIInput ImageI:0, I:100
OutputQOutput ImageQ:0, Q:50
MemoryMInternal FlagM:0, M:200

Data Types

Beckhoff data types map directly to Proxus types.

Proxus TypeIEC 61131-3 TypeSize
BoolBOOL1 bit
ShortINT16 bit
UShortUINT / WORD16 bit
IntDINT32 bit
UIntUDINT / DWORD32 bit
FloatREAL32 bit
DoubleLREAL64 bit
StringSTRING(n)Variable

Troubleshooting

ErrorCauseSolution
Target Machine Not FoundMissing ADS RouteAdd Static Route on PLC side (TwinCAT Router)
Target Machine Not FoundFirewallAllow TCP ports 48898 (ADS) and 8016
Ads Error 1793Service not supportedCheck if variable name is correct (Case sensitive!)
Ads Error 1808Symbol not foundEnsure "TPY" file is generated or "Symbol Download" is enabled
Connection RefusedWrong AMS PortUse 851 for TC3, 801 for TC2

Official Resources

lightbulb
Need More Help?

For data type issues, see Data Type Mismatch. For general connectivity problems, see Gateway Issues.