Defining the peripheral address

This chapter describes the definition of peripheral addresses for the MQTT driver.

Click on the _address config of a data point element, select the driver type MQTT and click on Configure... to open the following panel.

Figure 1. Definition of a peripheral address

Topic

The MQTT topic must be entered here for address configuration.

Wildcards (+ and #) are not supported.

E.g.:

home/sensors/17/temp

plant/valves/v24/isOpen

QoS

The Quality of Service level defines the guarantee of delivery for published/subscribed messages. For more information on Quality of Service, see Quality of Service.

  • 0: At most once

  • 1: At least once

  • 2: Exactly once

Mode Publish

The WinCC OA client is the publisher and defines the QoS level for messages sent to the broker.

Mode Subscribe

The WinCC OA client is the subscriber defines the max. QoS level which is evaluated by the broker when transmitting messages to the subscriber.

Retain

This flag defines whether the broker shall keep this topic's last message. If there is a new subscriber to this topic, it receives the retained message immediately. For more information on Retain, see Retain.

Driver number

Must match the number of the MQTT driver assigned to the connection.

Transformation protocol

The transformation protocol defines how values shall be interpreted and transmitted. You have to ensure that receiver and sender interpret the data in the correct way. Data can be transmitted either as plain string or JSON array. Depending on the selected JSON profile, the attributes value, timestamp and status can be read or written.

The actual WinCC OA data type to which the MQTT value shall be converted is deduced from the type of the respective data point element. In case of dyn data point elements, the corresponding MQTT value must be a JSON array.

In case of JSON transformations, the value range for data point elements of type long or ulong is also limited to 32bit.

Type of transformation Description
plain string Value as a plain string
JSON Profile Value JSON profile containing only the value
JSON Profile Value/Timestamp JSON profile containing value and timestamp
JSON Profile Value/Timestamp/Status JSON profile containing value, timestamp and status

Old/new comparison

This can only be used if the direction is set to input or in/out. If you select this option, the driver only sends data if the value has changed. The comparison is based on raw data without any conversion. The single bits of byte blocks are compared to old values. If a bit changes, the value in WinCC OA is updated.

Connection

Select the appropriate connection via this combo box.

Mode

Define whether values shall be

  • sent (Publish)

  • received (Subscribe)

  • sent/received (Both)

On Use

If set, values are only received when they are actually used, e.g. via UI or CTRL manager. Can only be selected in addition to the modes Subscribe or Both.