Internal data points of the MQTT driver

_MQTTConfig

There is only one instance of this internal data point, thus the settings defined here apply to all MQTT connections of a WinCC OA project.

Data point element Type Description
JsonProfiles dyn_string

List of JSON profiles. Each profile consists of the name and the list of WinCC OA attributes mapped to configurable JSON keys.

Supported WinCC OA attributes that can be mapped:

  • _value

  • _stime

  • _userbits

PublicKey string Public key of generated RSA key-pair (used in the UI only).

_MQTTConnection

An internal data point of this type is automatically created for each connection of the MQTT driver. The data point name is the same as the connection name.

For accessing elements of the node .Config or .Command the set user bit 4 (Administration) is required.

Data point element Type Description
Config.Address string

JSON encoded mapping for the connection to the broker. Consists of

  • connection type [uint]
  • connection string [string]
  • user name [string]
  • encrypted password [blob]
  • trusted broker certificate [string]
  • Client ID [string]
  • Client certificate [string]
  • Client certificate key [string]
  • Client certificate password [string]
  • Pre-shared key (encrypted) [blob]
  • TLS PSK Identity [string]
  • SSL version [uint]
  • Protocol version [uint]
Config.EstablishmentMode uint
  • 0: inactive

  • 1: automatically active (default)

Config.SetInvalidBit bool Defines if the invalid bit is set on connection loss.
Config.UseUTC bool

0: Local time plus timezone offset is used

1: UTC is written to PLC (default)

Config.DrvNumber uint Driver number of the MQTT driver in the project.
Config.CheckConn bool Defines if an _address config shall be added to check the connection.
Config.EnableStatistics bool

Enables the statistical evaluation of data for this connection.

Default = TRUE

Config.Timezone int Offset in minutes which is added to timestamps when local time is used.
Config.ReduAddress string JSON encoded mapping for the redundant connection to the broker.
Config.LastWill.Topic string Topic to which the last will message shall be sent on connection loss.
Config.LastWill.Message string Last will message which shall be sent on connection loss.
Config.LastWill.QoS uint

Quality of Service level for the last will message.

  • 0: At most once

  • 1: At least once

  • 2: Exactly once

Config.LastWill.Retain bool The topic's last message is retained i.e. kept by the broker and is sent to new subscribers.
Command.Enable bool Activates / deactivates the connection.
Command.IGQ bool Triggers an inverse general query, which means that all output addresses are written.
State.ConnState uint

Connection state:

  • 0: Inactive

  • 1: Disconnected

  • 2: Connecting

  • 3: Connected

  • 4: Disconnecting

  • 5: Failure

  • 6: Listening

State.DrvType string <driver type>:<driver number>
State.Disabled bool
State.ActiveConn int Index of the active connection to the broker.
State.Connections.State dyn_uint

Shows the current state of connection 1 resp. 2:

0: Disconnected

1: Connected

State.Statistics.WritesSent float Sent publish requests since driver start.
State.Statistics.WritesRej float Rejected publish requests since driver start.
State.Statistics.Notifications float Received topic notifications since driver start.
State.Statistics.WritesPerSec float Received write variable responses per second in last interval.
State.Statistics.NotificationsPerSec float Received topic notifications per second in last interval.