Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Go to the Inductive Automation download page again and scroll down to the Third Party modules section. Find the Cirrus Link modules section and download the MQTT Distributor, MQTT Engine, MQTT Transmission modules.
https://
inductiveautomation.com/downloads/ignition.  For each of the Ignition

Step 3: Configure the MQTT Modules

Once you have Ignition installed and running, and the MQTT Distributor, MQTT Engine and MQTT Transmission modules downloaded, browse to the Ignition Gateway console (e.g. http://localhost:8088).  Login using the default credentials of admin/password.  Click on Configuration tab and then click on the Modules tab on the left side of the page.  Scroll to the bottom of the Modules section and click on the Download/Upgrade modules button.  When prompted, select the MQTT Distributor module from the file browser and install it.  Do the same for the MQTT Engine and MQTT Transmission modules.  When complete, the Ignition Gateway Web UI module section should look similar to what is shown below:

Image Removed

Step 4: Use Ignition Designer to Examine the Initial Tag Structure

By default, MQTT Distributor, MQTT Engine, and MQTT Transmission are all configured out of the box to be able to connect locally to each other in the exact same architecture of this tutorial.  In addition, MQTT Engine will startup with outbound tag writes using the Sparkplug NCMD and DCMD messages blocked. For this tutorial we will want to enable tag writes. This is the only configuration change required for this tutorial.  To do so, open the MQTT Engine configuration tab in the Ignition Gateway console and click on the “Advanced Settings” tab. From this configuration screen you can disable command blocking by unchecking “Block Node Commands”, and “Block Device Commands” selections as shown below.  After doing so, save the changes.

Image Removed

With Ignition running and the Distributor, Engine, and Transmission modules loaded now we can open the Ignition Designer to observe some of the MQTT topology.  Regardless of the OS Ignition is running on, there is a “Launch Designer” button on the Ignition Gateway Console. From here you can launch your Designer on any machine.  This is shown below.  The default credentials for the designer are the same as the Gateway Console, admin/password.  Once you have logged into the Designer enter a new project name and open the project. The project name that we used for this tutorial is simply called “Tutorial1”.

Image Removed

After Designer opens, you will see the default Designer screen as shown below.

Image Removed

Once the MQTT Engine module is installed in Ignition, a new “Tag Provider” folder is created called “MQTT Engine”. The MQTT Engine folder will contain both process variable tags from field devices as well as metric and diagnostic information from the MQTT infrastructure itself. At this point in the tutorial we can use the tag browser to start looking at the simple MQTT infrastructure we already have running. In the tag structure below using the default MQTT Distributor and MQTT Engine configurations, you can see that the metrics provided for the MQTT Client connection from MQTT Engine to MQTT Distributor.

Image Removed

Step 5: Configure Transmission to Publish some Tags

Next, we need to create a folder structure where we will create a virtual MQTT Edge device and some tags to be published by MQTT Transmission.  When the Transmission module is installed in Ignition, a folder is automatically created in the Ignition tag structure with the following path:

  • All Providers/default/Edge Nodes

The is the default folder that Transmission will look at to an MQTT Sparkplug session from. For this tutorial, right click on the Edge Nodes folder and create a new folder called Tutorial Group. Then right click on the Tutorial Group folder and create another new folder called Tutorial Edge Node.  Finally, right click on the Tutorial Edge Node folder and create another new folder called Tutorial Device. This folder structure creates the same hierarchy that is described in the Sparkplug B specification of Group ID, Edge ID, and Device ID.

Image Removed

With this folder structure in place, now we can create some memory tags of various data types to publish. Right click on the Tutorial Device folder and select ’New Tag’/’Memory Tag’. In the tag editor change the Name of the tag to “Boolean001”, and change the Data Type to Boolean. Follow this same procedure for new memory tags called “Integer001” of type Integer, “Float001” of type Float, and “String001” of type String. The resulting folder structure should look as follows.

Image Removed

Now that we have a folder structure with some tags we can bring Transmission online.  Make sure that the Ignition Designer has read/write communications turned on by selecting Project/Comm Read/Write.

Image Removed

To bring Transmission online with the folder structure we’ve created, open the folder All Providers/MQTT Transmission/Transmission Control and click on the Refresh Boolean. When this happens, following the Sparkplug B specifications, the Transmission module will create an MQTT Session with the MQTT Server and then publish a NBIRTH message followed by a DBIRTH message.  Note the Boolean tag will not change to true.  This is really a one-shot and as a result, the tag will not change to true.

Then open the All Providers/MQTT Engine/Edge Nodes folder and refresh the Tag Browser.  The MQTT Engine MQTT Client has been subscribed to all Sparkplug B messages just waiting for a new Sparkplug B message to arrive. When we enabled Transmission to create a device structure with some tags, Engine was able to receive this message, and then using the Google Protocol Buffers schema, automatically create a new folder structure populated with the tags and metadata around this new device.  

Image Removed

At this point, memory tag values can be changed to generate events which in turn generates new MQTT messages.

Image Removed

instance, install the following MQTT Modules.

  • Ignition Primary
    • MQTT Distributor and MQTT Engine
  • Ignition Primary Backup
    • MQTT Distributor and MQTT Engine
  • Ignition Edge 1
    • MQTT Transmission
  • Ignition Edge 1 Backup
    • MQTT Transmission
  • Ignition Edge 2
    • MQTT Transmission
  • Ignition Edge 2 Backup
    • MQTT Transmission

Step 3: Configure the MQTT Modules

Once Ignition is installed, the MQTT Modules are installed, and everything is running we can configure the systems.  Since we are going to have a backup for each master system, we only need to do most of the configuration for the master systems.  Later, we can sync the configurations to the backups automatically.  We'll start by configuring the modules and configure the redundancy settings in the next stepAt this point you can create new tags in the default tag tree to add additional data points.  Any time you add new tags, you must click the 'Transmission Control/Refresh' boolean again to force MQTT Transmission to rescan the tag tree and publish new NBIRTH and DBIRTH messages.  It is also important to note that this architecture would not be used in a real world situations.  A more realistic yet still simple architecture would be to have MQTT Transmission on one Ignition instance and another Ignition instance which had MQTT Distributor and MQTT Engine installed.  This architecture would allow you to replicate tags from one Ignition instance to another using MQTT as the transport.  Also, in this example we used memory tags for simplicity.  However, OPC tags or other tag types could be used instead in the same manner for more real world solutions.