Adding a route in the Beckhoff PLC


The TwinCAT PLC software has a built-in mechanism to manage what devices are allowed to establish connections to the target. In order to allow access for a given device, a TwinCAT route must be configured on the PLC. The procedure for adding a route varies depending on the type of TwinCAT device.

Configure the route from Windows CE based TwinCAT 2 to the node

  1. Download the remote desktop software from Beckhoff and connect to the PLC. This software can be downloaded at this Beckhoff Information System site.
  2. On the Beckhoff TwinCAT PLC, open a command prompt.

  3. Type "cd Hard Disk/System" and press the enter key

  4. Type "TcAmsRemoteMgr.exe" and press the enter key. This will launch the route manager.
  5. Write down your PLC's AMS Net ID. This will be required when defining a Beckhoff TwinCAT 2 device (Using the Workbench to create a Beckhoff device).
  6. Click the "Add" button. A dialog box will be displayed enter values in the following fields.

    Field Label Value
    Name Enter a name that identifies the node.
    AMS Net ID Enter the IP address of the node where the driver is running. The IP address is followed by .1.1. For example if the node's ip address is 192.168.0.13, the AMS Net ID would be 192.168.0.13.1.1
    Address The IP address of the node. This value is the same as the AMS Net ID, without the .1.1
    Transport TCP/IP
  7. Click the "OK" button to save the new entry.

Configure the route from Windows NT based TwinCAT 2 to the node

  1. Using the TwinCat 2 display, open the Twin Cat System Properties. Click the Twin CAT icon on the bottom right and select properties.

  2. Click on the "AMS Router" tab and write down the "AMS Net ID". This will be required when defining a Beckhoff TwinCAT 2 device  (Using the Workbench to create a Beckhoff device).

  3. Click the "Add" button. A dialog box will be displayed enter values in the following fields.
    Field LabelValue
    NameEnter a name that identifies the node.
    AMS Net IDEnter the IP address of the node where the driver is running. The IP address is followed by .1.1. For example if the node's ip address is 192.168.0.13, the AMS Net ID would be 192.168.0.13.1.1
    AddressThe IP address of the node. This value is the same as the AMS Net ID, without the .1.1
    TransportTCP/IP


  4. Click the "OK" button to save the new entry. Restart the Twin Cat system by clicking on the Twin Cat icon followed by System -> Restart.

Configure the route from Windows 7 based TwinCAT 3 to the node

  1. Run the Windows remote desktop utility to connect to the TwinCAT 3 PLC.
  2. Open "Twin CAT System Control". All programs -> TwinCAT System -> TwinCAT System Control

  3. Open the "AMS Router" tab and write down the PLC's AMS Net ID. This will be required when defining a Beckhoff TwinCAT 3 device  (Using the Workbench to create a Beckhoff device).

  4. Open a windows explorer window and navigate to "C:\TwinCAT\3.1\Target

  5. Open “StaticRoutes.xml” using a text editor. Add a route entry for the DeviceWise node that will be connecting to the PLC. The format for each entry is:

    XML Attribute Value
    <Route>
    <Name> A descriptive name identifying the node.
    <Address> The IP Address of the node.
    <NetId> The IP Address of the node followed by .1.1
    <Type> TCP_IP
    </Route>

    Here is a sample entry.
    <Route>
         <Name>"Enterprise Gateway Node"</Name>
         <Address>"192.168.0.13"</Address>
         <NetId>"192.168.0.13.1.1"</NetId>
         <Type>"TCP_IP</Type>
    </Route>

    This is part of a full XML description. An example of the full XML description is shown.


  6. Put the TwinCAT in config mode by clicking the TwinCAT icon on the lower right, followed by the System->Config.

  7. Start the TwinCat by clicking the TwinCAT icon on the lower right, followed by System->Start/Restart