MqttConfig Class

MQTT configuration object

Inheritance Hierarchy

SystemObject
  TwinCAT.Ads.ConfigurationMqttConfig
    TwinCAT.Ads.ConfigurationRemoteEtherCATConfig

Namespace: TwinCAT.Ads.Configuration
Assembly: TwinCAT.Ads.ConfigurationProviders (in TwinCAT.Ads.ConfigurationProviders.dll) Version: 7.0.0+e56d35ccc4675faac24789a4aab60071fc61d470

Syntax

C#

public class MqttConfig

The MqttConfig type exposes the following members.

Properties

 

Name

Description

Address

Gets or sets the MQTT Broker address

CleanSession

Gets a value indicating whether [clean session].

ClientId

Gets the client identifier (ComputerName if not set)

DisplayName

Gets the display name (ComputerName if not set)

KeepAlive

Gets the keep alive.

NoRetain

Gets a value indicating whether [no retain].

Password

Gets or sets the MQTT Password

Port

Gets or sets the used MQTT port.

Psk

Gets or sets the PSK Security configuration

Qos

Gets the Quality of Service value or null.

Security

Gets the type of security.

Tls

Gets or sets the TLS Security configuration

Topic

Gets or sets the MQTT topic.

Unidirectional

Gets a value indicating whether this MqttConfig is unidirectional.

User

Gets or sets the MQTT User Name

WildcardWorkaround

Gets a value indicating whether [wildcard workaround].

Methods

 

Name

Description

Equals

Determines whether the specified object is equal to the current object.
(Inherited from Object)

Finalize

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)

GetHashCode

Serves as the default hash function.
(Inherited from Object)

GetType

Gets the Type of the current instance.
(Inherited from Object)

MemberwiseClone

Creates a shallow copy of the current Object.
(Inherited from Object)

ParseElement

Parses the element.

ToString

Returns a String that represents this instance.
(Overrides ObjectToString)

Remarks

The MQTT configuration is established as IConfiguration object in the application host. See AmsRouterConfiguration. A valid MQTT configuration could look like this (Environment variables)

Batch Script

AmsRouter__Mqtt__0__NETID=3.79.104.236.1.1 
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.2

Further information can be found at https://infosys.beckhoff.com/english.php?content=../content/1033/tc3_grundlagen/4320983179.html or https://github.com/Beckhoff/ADS-over-MQTT_Samples.

Reference

TwinCAT.Ads.Configuration Namespace

Beckhoff Automation GmbH & Co. KG 2001-2026