



NOTICE

If the MQTT client protocol is enabled, we recommend using the secure (TLS) variant of the MQTT protocol for protection of information.
The MQTT protocol is a lightweight communication protocol which is widely used on the internet to connect embedded device to the cloud.
The MQTT (Message Queuing Telemetry Transport) client library allows to integrate an AC500 processor module to act as a client in the MQTT protocol. Thus, it is possible to exchange data between the AC500 and other devices connected to the MQTT network.
In the figure below, there is an MQTT network with one broker (MQTT broker in the middle) and five clients. The figure shows the main functions of MQTT to send and receive data: publish and subscribe. The clients can publish messages with a specific topic to send data (e. g. the temperature of a connected sensor with a timestamp) to the MQTT broker. For example, the client “AC500_1” publishes a message to topic “topic/2”. On the other hand side clients can also subscribe to topics to receive data. For example, the client “Laptop” has subscribed topic “topic/2”. So all messages with the topic “topic/2” which has been published to the MQTT broker will be sent immediately to the client “Laptop”. This creates a message flow from the client "AC500_1" to the laptop.

To realize the MQTT behavior, there are several function blocks implemented in the ⮫ MQTT client library.
TLS version
The MQTT client uses the TLS version 1.2.
Configuration in Automation Builder
For the MQTT client no configuration is needed.
Configuration in CODESYS
All function blocks have to be called in tasks with cyclically processing.
You can use the function blocks with the following:
-
PLC_PRG with automatic task configuration or manual task configuration.
-
One single program or different programs.
-
One single task or different tasks.
With different programs assigned to different tasks you can define different cycle times and priorities.
Limitation
No persistent session. After an interrupted connection, the client needs to subscribe on topics again in case of reconnect.
Hardware
The MQTT protocol requires an AC500 device (PM5032 or higher) with integrated Ethernet.