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

Compare with Current View Page History

« Previous Version 10 Next »

Overview

MQTT Engine has the ability to consume incoming Sparkplug messages and organize metrics in the same hierarchical fashion to construct the Unified NameSpace.

Essentially, MQTT Engine creates a clean implementation by obfuscating the SPARKPLUG descriptors, included in the Sparkplug topic, and using the metric names from the payload to create the tags.

A requirement of a UNS is that each tag can only be referenced from a single source ie. the same tag path cannot be published from two edge nodes.

Configuration

Configuration is set in the Sparkplug B namespace under MQTT Engine > Namespaces > Sparkplug B > Default > General as shown below:


Example

Let's take a look at a an example of how a UNS can be created at MQTT Engine from Edge Node tags published by MQTT Transmission. 

Review the MQTT Transmission Transmitters and Tag Trees to gain an understanding of how MQTT Transmission Transmitter configurations interact with Ignition tag trees to publish Sparkplug messages and the immense flexibility that can be realized.


In the attached sample gateway backup, we have configured four tag providers to simulated four Edges - Site 1A, Site 1B, Site 1C and Site 2. 



MQTT Transmission Transmitters each publishing tags from a different tag provider at the Edge.

Each of the se the Ignition tag tree in the default tag provider at the Edge to construct the Sparkplug Device Descriptor (group_id, edge_id and device_id) starting at the folder level below Edge Nodes.

For the Ignition tag tree below, the topic and payload for a change to tag T1 will






be:

Topic: spBv1.0/G1/DDATA/E1/D1

SparkplugBPayload: [timestamp=1726851053618, metrics=[Metric [name=Vancouver/Area1/Line1/Zone1/Asset1/T1, alias=null, timestamp=1726851052615, dataType=Int32, isHistorical=null, isTransient=null, metaData=null, properties=PropertySet [propertyMap={}], value=10, isNull=false]], seq=3, uuid=null, body=null]


At MQTT Engine, the metric name is parsed and the tag structure created under the configured UNS folder name.

The tag has three additional properties which identify the Sparkplug Descriptor associated with this tag: 

  • SparkplugGroupId
  • SparkplugEdgeNodeId
  • SparkplugDeviceId



The Sparkplug Descriptor properties, SparkplugDeviceId, SparkplugEdgeNodeId and SparkplugGroupID, for UDT Instance tags are inherited from the parent UDT Instance and can be viewed in the tag editor for the UDT Instance:




Currently it is possible to manually edit the Sparkplug Descriptor properties for a UNS tag at MQTT Engine. The edits will hold until a BIRTH message is received from the Edge Node.

These tags are not used internally by MQTT Engine and the tag will remain associated with the original Sparkplug Descriptor. For example if the SparkplugDeviceId associated with Vancouver/Area1/Line1/Zone1/Asset1/T1 is changed to D17, new data coming in from spBv1.0/G1/DDATA/E1/D1 for metric Vancouver/Area1/Line1/Zone1/Asset1/T1 will still be written to the tag.

However, these tag properties are used by UNS Transmitter to create the .props message associated with the tag. Any refresh of the edge node at the UNS Transmitter will result in a .props message being published with the edited Sparkplug Descriptor properties.



In addition to creating the UNS folder, for each connected Edge Node, a Node Control and Node Info folder containing tags is created along with a Device Info folder for each connected device. See the Engine Tags documentation for details on each of these tags.

Under the Device Control and Node Control folders there is a "Delete UNS Tags" tag. This tag makes it simple to delete the tags for the respective Edge Node or Device without having to parse through the UNS tag tree to find the associated tags.

The security on this tag is set to Read Only = True and will need to be updated to Read Only = False before the boolean can be written to.

MQTT Engine



Colliding Tag Paths

A requirement of a UNS is that each tag can only be referenced from a single source ie. the same tag path cannot be published from two edge nodes.

To help identify colliding UNS tag, the SparkplugBPayloadHandler will at Error level when parsing a tag name that is already associated with a different Sparkplug Descriptor. 




  • No labels