RouterConfig Class
Router Configuration class (AmsRouter configuration)
Inheritance Hierarchy
SystemObject
TwinCAT.Ads.ConfigurationRouterConfig
Namespace: TwinCAT.Ads.Configuration
Assembly: TwinCAT.Ads.ConfigurationProviders
(in TwinCAT.Ads.ConfigurationProviders.dll) Version:
7.0.0+e56d35ccc4675faac24789a4aab60071fc61d470
Syntax
C#
public class RouterConfigThe RouterConfig type exposes the following members.
Properties
|
|
Name |
Description |
|---|---|---|
|
|
Gets or sets the Ads/Ams infrastructure to use (Default: All) | |
|
|
Gets or sets the used ADS Channel protocol (to force specific protocols, Default: All) | |
|
|
Gets or sets the loopback externals. | |
|
|
Gets or sets the allowed Subnet for the Loopback communication. | |
|
|
Gets or sets the IPAddress used for local communication (Loopback ip). | |
|
|
Gets or sets the TCP Port that is used for the loopback. | |
|
|
Gets or sets the MQTT configurations. | |
|
|
Gets or sets the name of the local System (Router) | |
|
|
Gets or sets the NetID of the local System. | |
|
|
Gets or sets the remote Routes/Connections. | |
|
|
Gets or sets the TCP port used for external communication (Default: 0xBF02) | |
|
|
Gets or sets the UDP discovery port that is used by the Broadcast. |
Methods
|
|
Name |
Description |
|---|---|---|
|
|
Determines whether the specified object is equal to the current
object. | |
|
|
Allows an object to try to free resources and perform other
cleanup operations before it is reclaimed by garbage
collection. | |
|
|
Serves as the default hash function. | |
|
|
Gets the Type of the current
instance. | |
|
|
Creates a shallow copy of the current Object. | |
|
|
Returns a string that represents the current object. |
Remarks
The content of the configuration is read by a so called configuration builder (https://learn.microsoft.com/en-us/dotnet/core/extensions/configuration). A set of environment variables for using 'AdsOverMqtt' looks like this:
Batch Script
# Basic ADS-Router config which has to match StaticRoutes on TwinCAT-Host systems
# Set the Router Name
AmsRouter__Name=MqttRouter
# Set the Local AmsNetId for this sample
AmsRouter__NetId = 42.42.42.42.1.1
#Use All Channel protocols: 1st try standard AMS, 2nd fallback to Mqtt
AmsRouter__ChannelProtocol=All
AmsRouter__Mqtt__0__NORETAIN = false
AmsRouter__Mqtt__0__UNIDIRECTIONAL=false
AmsRouter__Mqtt__0__PORT=8883
AmsRouter__Mqtt__0__ADDRESS=ba-0f8cfe2680560cffb.eu-central-1.demo.beckhoff-cloud-instances.com
AmsRouter__Mqtt__0__TOPIC = VirtualAmsNetwork1
AmsRouter__Mqtt__0__TLS__IGNORECN=false
AmsRouter__Mqtt__0__TLS__CA__0=C:\Program Files(x86)\Beckhoff\TwinCAT\3.1\Target\Certificates\BA-0f8cfe2680560cffb\intermediateCA.pem
AmsRouter__Mqtt__0__TLS__CERT = C:\Program Files(x86)\Beckhoff\TwinCAT\3.1\Target\Certificates\BA-0f8cfe2680560cffb\MyDevice.pem
AmsRouter__Mqtt__0__TLS__KEY = C:\Program Files(x86)\Beckhoff\TwinCAT\3.1\Target\Certificates\BA-0f8cfe2680560cffb\MyDevice.key
AmsRouter__Mqtt__0__TLS__VERSION = tlsv1.2Internally, in the IConfiguration section dictionary, thise key value associations look like this:
Batch Script
AmsRouter:Name=MqttRouter
AmsRouter:NetId = 42.42.42.42.1.1
AmsRouter:ChannelProtocol=All
AmsRouter:Mqtt:0:NORETAIN = false
AmsRouter:Mqtt:0:UNIDIRECTIONAL=false
AmsRouter:Mqtt:0:PORT=8883
AmsRouter:Mqtt:0:ADDRESS=ba-0f8cfe2680560cffb.eu-central-1.demo.beckhoff-cloud-instances.com
AmsRouter:Mqtt:0:TOPIC = VirtualAmsNetwork1
AmsRouter:Mqtt:0:TLS:IGNORECN=false
AmsRouter:Mqtt:0:TLS:CA:0=C:\Program Files(x86)\Beckhoff\TwinCAT\3.1\Target\Certificates\BA-0f8cfe2680560cffb\intermediateCA.pem
AmsRouter:Mqtt:0:TLS:CERT = C:\Program Files(x86)\Beckhoff\TwinCAT\3.1\Target\Certificates\BA-0f8cfe2680560cffb\MyDevice.pem
AmsRouter:Mqtt:0:TLS:KEY = C:\Program Files(x86)\Beckhoff\TwinCAT\3.1\Target\Certificates\BA-0f8cfe2680560cffb\MyDevice.key
AmsRouter:Mqtt:0:TLS:VERSION = tlsv1.2Other Resources
https://learn.microsoft.com/en-us/dotnet/core/extensions/configuration
Beckhoff Automation GmbH & Co. KG 2001-2026