×
Siemens Industry Online Support
Siemens AG
Entry type: Application example, Entry ID: 109748872, Entry date: 08/16/2018
(10)
Rate

MQTT Publisher for SIMATIC CPU

  • Entry
  • Associated product(s)
The “Message Queue Telemetry Transport” is a simple protocol on TCP/IP level. It is suitable for messaging between devices with minimum functionality and for transmission via unreliable networks. With the function block from this application example, the MQTT protocol is implemented into a SIMATIC S7-1500, SIMATIC S7-1200 and SIMATIC S7-300.
Lean and fast: MQTT
The “Message Queue Telemetry Transport” is a simply structured binary Publish/ Subscribe protocol on TCP/IP level. It is suitable for messaging between devices with minimum functionality and for transmission via unreliable networks with low bandwith and high latency. With these characteristics, MQTT plays a vital role for the IoT and in M2M communication.

Application-related implementation
The application example provides you with a function block for the SIMATIC CPU. The “LMqtt_Publisher” function block integrates the MQTT client function and allows you to transmit MQTT messages to a broker (publisher role). In this, the communication can be secured via a TLS connection. You can reach the broker with a static ip address or a qualified domain name.

The following picture shows the secure mqtt-messaging with a SIMATIC S7-1500.
 


Bild 01

Advantages of MQTT
The MQTT protocol stands out with the following characteristics:

  • Light-weight protocol with low transport overhead

  • Minimum requirement for network bandwith thanks to push mechanism

  • Function for re-connecting after disconnection

  • Re-sending messages after disconnection

  • Mechanism for notifying interested parties after an unpredicted disconnection of a client

  • Simple use and implementation thanks to a small set of commands

  • Quality of Service (QoS level) with different reliability levels for the message delivery

  • Optional encryption of messages via SSL/TLS

  • Authentification of publishers and subscribers via user name and password

Documentation and project example for an secure messaging (S7-1500)
 Registrierung notwendig  Library (TIA Portal V15) (1,4 MB) 
  Documentation (1,5 MB) 

Documentation and project example for an unsecure messaging (S7-1500, S7-1200, S7-300)
 Registrierung notwendig  Library for S7-1200 / S7-1500 (TIA Portal V15) (1,7 MB) 
 Registrierung notwendig  Library for S7-300 (TIA Portal V15) (956,6 KB) 
  Documentation (1,3 MB) 

Archive
In the archive you find the old libraries for TIA Portal V14 SP1
 Registrierung notwendig  Archive (2,1 MB)

Last Changes
Integration of the variant, to reach the broker with a qualified domain name.

Security information
In order to protect plants, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art industrial security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about industrial security, please visit
http://www.siemens.com/industrialsecurity.