AmsConfiguration.RouterEndPoint Property

Gets or sets the default router IPEndPoint.

Namespace:  TwinCAT.Ams
Assembly:  TwinCAT.Ads.Abstractions (in TwinCAT.Ads.Abstractions.dll) Version: 6.0.328+39e3229

Syntax

C#

public static IPEndPoint RouterEndPoint { get; set; }

Property Value

Type: IPEndPoint
The IPEndPoint used by Ams Clients/Servers.

Remarks

This setting allows to change the Router Endpoint - which listens by default on IPAddress 127.0.0.1, Port 0xBF02. An application for this could be to move the router to a different (virtual) system, separated from the system running the AdsServer or AdsClient. This endpoint can only be changed process wide and should be done before the first access to the Router occurs (e.g. getting the local NetId).

ATTENTION: Bending this Endpoint is not possible with the standard TwinCAT Router. As security feature the TwinCAT Router only accepts Loopback connections to 127.0.0.1, connection requests from the outside will be closed immediately.

The simplistic .NET Core Router implementation in class 'TwinCAT.Ads.AdsRouter.AmsTcpIpRouter' from nuget package 'Beckhoff.TwinCAT.Ads.TcpRouter' or the 'Beckhoff.TwinCAT.Ads.AdsRouterConsole' doesn't have that restriction and can be used more flexible for use with virtual environments like VirtualMachines or Docker. flexible.

The following sample demonstrates how to configure the (internal) RouterEndPoint to IPAddress 1.2.3.4:42 . This must be done before AdsServer or AdsClient are instantiated.

AmsConfiguration.RouterEndPoint = new IPEndpoint(IPAddress.Parse("1.2.3.4"),42);

Reference

AmsConfiguration Class

TwinCAT.Ams Namespace