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

Compare with Current View Page History

Version 1 Next »

Abstract

This page describes how Cloud Injector Agent configurations interact with Ignition tag trees to push messages and tag change events to the cloud service. It explains how tags get identified to be pushed as well as what specific 'topics' will be included with the messages. It also goes over some example configurations to show how the system will behave in different scenarios.

Sparkplug Overview

Cloud Injectors utilize concepts of the Sparkplug Specification for MQTT. The Cloud Injector modules are designed to pick up tags in Ignition or Ignition Edge and publish those tags, parts of their configuration, and tag change events to an MQTT Server. These tags are push to the Cloud Service based on a combination of a 'Agent' configuration as well as the arrangement of tags in the Ignition tag tree.

It is important to note that the configuration of the 'agents' in conjunction with the tag tree determines some of the data used in pushing the messages to the cloud service. The 'topics' are meant to be used as the addresses of the different components in the distributed system. It is important to note with the various cloud services that these topics are not really MQTT topics. Instead, they are included in the message as part of the JSON document. But, they are conceptually used in the same way as they are in the Sparkplug Specification. For the remainder of this document, the 'topic' will refer to a portion of the JSON document that is pushed to the cloud service and not an actually MQTT topic. Note this really only applies to the Cloud Injector modules and not the MQTT modules such as MQTT Transmission and MQTT Engine. In the topics per the Sparkplug specification, there are three important identifiers to note. These are shown below.

Sparkplug Identifiers
  • The 'Group ID' is meant to represent a logical grouping of Edge Nodes. This can be a region, a facility name, or any meaningful grouping of Edge Nodes within your application.
  • The 'Edge Node ID' is the ID of the logical Edge Node. This is often the name that represents the component which is aggregating data from various Sparkplug Devices.
  • The 'Device ID' is the ID of a device attached to the Ignition instance. This can be a PLC or logical grouping of tags the represent a physical or logical device connected to Ignition.

These identifiers then become components of the MQTT topics. There is also a 'verb' in Sparkplug messages which denotes whether the message is a birth certificate, death certificate, data message, command message, etc. Sparkplug topics are of the following form using all of these different parameters.

  • spBv1.0/GROUP_ID/VERB/EDGE_NODE_ID/DEVICE_ID

It is also important to note that the combination of any GROUP_ID and EDGE_NODE_ID must be unique within the distributed system. Because these are used as 'addresses' in the system you should never have two that conflict with each other. It is a bit like having two houses with the same postal address. It isn't possible for other MQTT clients in the system to tell where messages are coming from and when sending messages to them they will both receive the messages. This is why the combination of these two identifiers must be unique. For example, you can have two or more Edge Nodes with the same GROUP_ID as long as each EDGE_NODE_ID is unique.

Agents and Tag Trees

MQTT Transmission for Ignition 7.9.x has two different types of Transmitters. There is the 'default' Transmitter and also 'custom' Transmitters. Transmitters define where in the tag tree MQTT Transmission will look for tags that should be published via MQTT. They also optionally define the 'Sparkplug Identifiers' that will be used in the topic namespace.

Default Transmitter

In the original release of MQTT Transmission the Default Transmitter was the only mechanism that could be used to define which tags would be published over MQTT. When in use, it would look in the specified Tag Provider that is configured for a folder called 'Edge Nodes'. Each folder under the 'Edge Nodes' folder would be considered a Sparkplug 'Group ID'. Each folder under each 'Group ID' folder would be considered a 'Edge Node ID'. Finally, each folder under each 'Edge Node ID' folder would be considered a 'Device ID'.

Consider the following tag tree:

With the above tag tree while using MQTT Transmission's Default Transmitter we end up with the following Sparkplug Edge Nodes.

  • Edge Node with Group ID=G1 and Edge Node ID=E1 with one Device with Device ID=D1
  • Edge Node with Group ID=G2 and Edge Node ID=E1 with one Device with Device ID=D1
  • Edge Node with Group ID=G2 and Edge Node ID=E2 with two Devices with Device ID=D1 and Device ID=D2

Note each Edge Node also results in a single MQTT Client connection. So, the above configuration results in three Sparkplug MQTT clients publishing messages to an MQTT Server.

It is important to note that the Default Transmitter no longer exists in Ignition 8. This is because a Custom Transmitter can be defined to represent the Default Transmitter.

Custom Transmitters

Custom Transmitters were created later in the development of MQTT Transmission. This was done to provide more flexibility in how tags could be picked up and published over MQTT. The biggest difference between a Custom Transmitter and the default Transmitter is how the Sparkplug Group, Edge Node, and Device IDs get defined. The Default Transmitter picks all of these up via folders in the tag tree. Custom Transmitters allow these to be defined in the Transmitter configuration itself.

Consider the following Custom Transmitter configuration.

Now consider the following tag tree:

With this Custom Transmitter configuration and tag tree we end up with the following Sparkplug Edge Node.

  • Edge Node with Group ID=G1 and Edge Node ID=E1 with two Devices with Device ID=D1 and Device ID=D2

Note because these was no Device ID specified in the Custom Transmitter configuration the Device IDs still get picked up from the tag tree. Alternatively the Device ID could be specified in the Custom Transmitter configuration and they would not be picked up from the tag tree.

Additional Resources

  • No labels