You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

How can we use Cirrus Link's Sparkplug MQTT Transmission and MQTT Engine modules along with the common ISA-95 equipment model of Enterprise > Site > Area > Line > Equipment to map the model data into a Unified NameSpace.


Sparkplug Basics

Sparkplug defines a standard format for MQTT message topic paths of:

spBv1.0/group_id/Message Type/edge_node_id/device_id 

Sparkplug defines a standard format for MQTT message payloads of:

{         
  "timestamp": <timestamp>,         
  "metrics": [{                 
    "name": <metric_name>,                 
    "alias": <alias>,                 
    "timestamp": <timestamp>,                 
    "dataType": <datatype>,                 
    "value": <value>
  }],
  "seq": <sequence_number>
}

where the ‘name’ of a metric can be hierarchical to build out proper folder structures for applications consuming the metric values.


For example, a simple Sparkplug™ B payload with a two metrics can be represented in JSON as follows:

{         
  "timestamp": 1486144502122,         
  "metrics": [{                 
    "name": "Metric1",                 
    "alias": 1,                 
    "timestamp": 1479123452194,                 
    "dataType": "String",                 
    "value": "Test"         
  },
  {                 
    "name": "Metric Level 1/Metric Level 2/Metric2",                 
    "alias": 2,                 
    "timestamp": 1479123452056,                 
    "dataType": "String",                 
    "value": "Test"         
  }],         
  "seq": 2
} 
Using this convention, in conjunction with the group_id, edge_node_id and device_id already defined in the Topic Namespace, consuming applications can organize metrics in the same hierarchical fashion.


Let's take a look at a couple of examples using MQTT Transmission and MQTT Engine. 

We have configured an MQTT Transmission Transmitter to use the Ignition tag tree at the edge to construct the group_id, edge_id and device_id starting at the folder level Site_1. With this configuration, the topic and payload for a change to Tag 1 will be:

  • Topic: spBv1.0/Site 1/DDATA/Area 1/Line 1
    • Payload: {"timestamp":1643823757750,"metrics":[{"name":"Equipment 1/Tag 1","timestamp":1643823756467,"dataType":"Boolean","value":True}],"seq":23}

At MQTT Engine, this hierarchal metric name is parsed and the edge folder structure recreated

This document describes how MQTT Transmission Transmitter configurations interact with Ignition tag trees to publish Sparkplug messages MQTT Transmission Transmitters and Tag Trees
  • No labels