Follow

Data Consumer - MQTT Consumer

The integration concept can be extended to share measure and KPI data with more “Real Time” systems by using the MQTT protocol.  Important KPIs relating to operator performance can now be made available for users in traditional SCADA/HMI solutions to make decisions based on KPIs that cannot be calculated with data originating solely from the control system, for example, Planned vs. Actual Production.

This leverages Flow as a decision support system, making information available to anyone and everyone in the plant, from Operations to Management.

The merging of real time visualization KPIs and historical KPIs has becomes ever more important to truly optimize plant efficiency and performance.  This can be achieved by the MQTT consumer.

Potentially, OPC sources can also be updated via this method. (Most drivers that SCADA/HMI systems use to connect to a MQTT Broker can also act as an OPC Server).

The Flow MQTT Consumer act as a bridge between Flow data and an MQTT Broker.

The MQTT Consumer supports three different type of protocols to construct your MQTT Topic and Payload:

  • Custom
  • Sparkplug B
  • Flow Topic Definition
Note: An MQTT Broker must be configured and set up separately to the Flow install/configuration. A local or hosted MQTT Broker may be used. If a hosted MQTT Broker is being utilized, the platform where the Integration Engine is deployed must have internet access and be able to communicate with the MQTT Broker.

 

Configuring an MQTT Consumer

To create a connection to a MQTT Consumer, right-click on Data Consumers to add a new Consumer. Select “More”.

This will list the MQTT Consumer called “MQTT Broker”. Select The “MQTT Broker” consumer to open its editor:

MQTT_Consumer_-_Selecting_in_Integration_Tab.png

To successfully push data to a MQTT Consumer, the following properties needs to be set.

MQTT_Broker_-_Consumer_Properties.png

  • Name (String)
Name to identify the consumer.
  • MQTT Server (String)
Location of the server or address where your MQTT Broker is defined (Server Name or IP Address).
  • Username (String)
Username to connect to the MQTT Broker (if required).
  • Password (String)
Password to connect to the MQTT Broker (if required).
  • Quality of Service
Select the Quality of Service for the payload to the MQTT Broker.
  • Protocol
Select from either Custom, SparkplugB, or a Flow Topic and Payload definition.
  • Payload Format
If “Custom Protocol” is selected, this property will be visible to define a custom Payload.
  • Topic Format
If “Custom Protocol” is selected, this property will be visible to define a custom Topic.
   

After configuring the properties, test the connection by clicking the “Test” button. If successful, a pop-up will confirm your connection or display an error message describing the issue that needs to be rectified.

MQTT_Consumer_-_Test_Connection.png

Note: The test procedure will connect to the MQTT Broker and try to retrieve the version of the MQTT Broker via the $SYS/broker/version topic. MQTT Brokers that do not support this topic will not respond to Flow's "Test" procedure, but you can still use them for the integration.

 

Protocols

Custom Protocol Definition

If "Custom" is selected from the protocol drop-down menu, it will allow you to define custom Payload and Topic definitions.  Certain properties may be used as placeholders to be replaced by the MQTT Consumer before sending a message.

MQTT_Broker_-_Custom_Payload_and_Topic.png

Note: Please be aware that MQTT Topics are case sensitive, so take this into account when subscribing to a topic that has been constructed with your custom Topic definition.

A Topic Example is provided below:

/[metric]/[Name]/[measureID]

Properties available to use in the Topic Definition include:

  • [modelattribute(“ModelAttributeName”)]
  • [metric]
  • [name]
  • [intervaltype]
  • [measureid]
  • [measureuom]
  • [hierarchicalname]
  • [periodend]
  • [periodstart]
  • [periodendutc]
  • [periodstartutc]
  • [quality]
  • [timeschemeshift]
  • [value]

A Payload Example is provided below:

{"name":"[name]","measureValue":"[value]"}

Properties available to use in the Payload Definition include:

  • [modelattribute(“ModelAttributeName”)]
  • [metric]
  • [name]
  • [intervaltype]
  • [measureid]
  • [measureuom]
  • [hierarchicalname]
  • [periodend]
  • [periodstart]
  • [periodendutc]
  • [periodstartutc]
  • [quality]
  • [timeschemeshift]
  • [value]

SparkPlugB

The Flow MQTT Consumer implements the SparkplugB protocol definition to automatically configure a Topic and Payload structure to build out a Flow-specific namespace for any subscriber that can consume the SparkplugB definition, and allows for the auto-population of device tags.

An Example of the namespace can be seen below:

SparkplugB_-_Example_Namespace.png

The implementation of the SparkplugB protocol will generate a namespace with the following hierarchical structure:

SparkplugB_-_Namespace_Hierarchical_Structure.png

Flow Topic Definition

The "Flow Topic Definition" Topic Format implements the following definition structure:

Flow_Topic_Definition_-_Namespace_Hierarchical_Structure.png

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments