Example: ADS Routing via Gateway

This example is used to describe how an ADS device (e.g. TwinCAT PLC Control, TwinCAT System Manager, third-party Scada systems etc...) can communicate with a TwinCAT PLC in a heterogeneous network.

This is the specific scenario: A "service notebook" (SN-PC1 in this example) from IP segment 172.16.5.x is to communicate with a TwinCAT controller (TC-PC3) via a gateway PC (GW-PC2 in this example).

This article describes the required hierarchical ADS routing entries. These can be generated manually or via the "TwinCAT Remote Manager".

Example: ADS Routing via Gateway 1:

ADS routing: Logical ADS destination address and physical (IP) destination address

Background information: ADS is a message-based communication system. An ADS message cannot be sent directly from SN-PC1 to TC-PC3 via entry "ADS-NetID and TCPIP from TC-PC3": The IP address of TC-PC3 is not accessible in the IP segment of SN-PC1.

While, from the perspective of SN-PC1, the "logical destination address" relating to ADS is the ADSNetID of TC-PC3, the "physical transport address" is GW-PC2.

This type of ADS route configuration is documented in detail here:

 

Requirement for all PCs: TwinCAT 2.10 Build 1244 (or higher)

ADS routing settings of the PCs:

Example: ADS Routing via Gateway 2:

Registry entries

These registry entries can be entered manually, although we recommend using the TwinCAT Remote Manager tool.

SN-PC1 (Service Notebook)

[HKEY_LOCAL_MACHINE\SOFTWARE\Beckhoff\TwinCAT\Remote\GW-PC2]
"Address"="172.16.5.80"
"AmsNetId"=hex:c0,a8,03,50,01,01  -> 192.168.3.80.1.1
...
[HKEY_LOCAL_MACHINE\SOFTWARE\Beckhoff\TwinCAT\Remote\GW-PC2\TC-PC3]
"Address"="192.168.3.21"
"AmsNetId"=hex:c0,a8,03,15,01,01   -> 192.168.3.21.1.1
...

GW-PC2 (Gateway)

[HKEY_LOCAL_MACHINE\SOFTWARE\Beckhoff\TwinCAT\Remote\SN-PC1]
"Address"="172.16.5.65"
"AmsNetId"=hex:ac,10,05,41,01,01   -> 172.16.5.65.1.1
...
[HKEY_LOCAL_MACHINE\SOFTWARE\Beckhoff\TwinCAT\Remote\TC-PC3]
"Address"="192.168.3.21"
"AmsNetId"=hex:c0,a8,03,15,01,01   -> 192.168.3.21.1.1
...

TC-PC3 (TwinCAT Controller)

[HKEY_LOCAL_MACHINE\SOFTWARE\Beckhoff\TwinCAT\Remote\PC2]
"Address"="192.168.3.80"
"AmsNetId"=hex:c0,a8,03,50,01,01  -> 192.168.3.80.1.1
...
[HKEY_LOCAL_MACHINE\SOFTWARE\Beckhoff\TwinCAT\Remote\PC2\PC1]
"Address"="172.16.5.65"
"AmsNetId"=hex:ac,10,05,41,01,01   -> 172.16.5.65.1.1
...