Subscribe to MQTT Message Broker

The following section describes step-by-step how to use the configurator to subscribe to an MQTT Message Broker and to write received data into ADS variables.

Configure MQTT gate, channel and symbols

Follow the step-by-step instructions to create an MQTT gate and a subscriber channel and add symbols to the channel’s configuration.

The topology view is activated.
1. Right-click the canvas and select Add Gate (MQTT).
2. Select the new gate and configure MQTT related settings in the properties window (Broker address, …).
3. Right-click the new gate and select Add Channel (Subscriber).
4. Select the new channel and set “SamplingMode” to “OnChange” and “Formatter” to “Simple JSON”. Leave all other fields on their default settings. Make sure that the MQTT topic matches the topic name on which you receive data.
5. Right-click the channel and select Add Symbol. Configure the symbol related settings, e.g. the symbol name. In case of a JSON data format, the name must match a JSON key in the JSON document received by the TC3 IoT Data Agent. Make sure to set the correct data type.
A MQTT gate and a subscriber channel have been created. Symbols have been added to the channel.
Subscribe to MQTT Message Broker 1:

Data format

Make sure that the data format of the received message payload corresponds to the configured data format. Otherwise, the TC3 IoT Data Agent cannot parse the content of the message and process the data.

Configure ADS gate, channel and symbols

Follow the step-by-step instructions to create an ADS gate and a publisher channel. Add symbols to the channel’s configuration.

The topology view is activated.
1. Right-click the canvas and select Add Gate (ADS).
2. Select the new gate and configure ADS related settings in the properties window (AmsNetId, AdsPort, …).
3. Right-click the new gate and select Add Channel (Publisher).
4. Select the new channel and set “SamplingMode” to “OnChange”. Leave all other fields on their default settings
5. Open the Target Browser.
6. Navigate to the ADS device and add the symbols to the configuration by dragging them to the publisher channel.
An ADS gate and a publisher channel have been created. Symbols have been added to the channel.
Subscribe to MQTT Message Broker 2:

AMS Net ID

Make sure that the AMS Net ID, that has been configured on the ADS gate, matches the ADS device that you selected with the target browser.

Create mapping

Follow the step-by-step instructions to create a mapping between source and destination symbols. Note that a mapping can only be created between channels that have different roles (e.g. between a subscriber and a publisher channel and vice versa).

Drag-and-drop - Channel:

While holding the CTRL key, drag the subscriber channel to the publisher channel.

The configurator automatically creates new symbols on the publisher channel and a mapping between the source and destination symbol.

Drag-and-drop – Symbol:

While holding the CTRL key, drag a symbol from the subscriber channel to either an existing symbol on the publisher channel or to the publisher channel itself.

The configurator creates a link between source and destination symbol or, if the symbol has been dragged to a channel object, creates the destination symbol automatically

Activate configuration

Follow the step-by-step instructions to activate the currently opened configuration.

1. Select the target system via the toolbar.
2. Click the Activate Configuration button.
A dialog opens asking if you want to switch the target TC3 IoT Data Agent into run mode.
3. Confirm the dialog with Yes if you want to switch the mode. Otherwise, choose No.
The configuration is activated.