Versions Compared

Key

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

...

 


Overview:

Transmission is an MQTT module for Ignition that can convert Ignition tag data and tag change events into MQTT messages to be consumed by MQTT Engine or other MQTT clients.  This tutorial will show how to configure MQTT Transmission to send OPC tag data in Ignition as MQTT messages via MQTT Distributor to MQTT Engine where they will be displayed.

The topology of this example shows MQTT Distributor, MQTT Engine, and MQTT Transmission all running in the same Ignition instance.  This is done for simplicity of the tutorial.  But, this isn't required or even intended to be a real use case.  In a more realistic scenario MQTT Transmission and MQTT Engine would be located on separate machines. 


Variations:

This tutorial shows how to use OPC tags and MQTT Transmission to generate MQTT messages based on tag change events.  However, the tag source does not have to be an OPC tag.  Instead, as long as the tag structure for MQTT Transmission is followed, any Ignition tag can be used to generate MQTT messages and/or be controlled via MQTT messages.

 


Sending OPC Tag Data with Transmission:

...

In this example we're going to use the "default" tag provider within Ignition Enterprise.  Expand 'All Providers' in the Tag Browser and select 'default'.  Note that if Ignition Edge is being used, the tag provider will be named 'edge'.

 


With 'default' (or 'edge') selected, click the 'OPC' icon in the Tag Browser icon list:

 


This will open a new window as shown below.  If the OPC server and client were set up and configured properly, you should see something similar to the following:

 


Note there is a device with an attached PLC and two sets of registers.  Yours will look different based on the device you are using and how it is configured.  At this point, we can select the device (CLTEST002DIRECTOR in this case) and drag it into the Tag Browser under the 'default' Tag Provider.  This is shown below:

 


The first level of folders is very important in terms of layout and how the tags will be understood and represented by MQTT Transmission.  These are the rules:

  • For terminology reference, please review the Sparkplug specification if you have not done so.
  • Under the Tag Provider, the first folder must be exactly 'Edge Nodes'
  • Under the 'Edge Nodes' folder a 'Group ID' must be next.  This can be anything you want but realize it represents a group of edge nodes.  You can have as many group IDs as you want.
  • Under 'Group ID' you can one or more Edge Nodes.
  • Under each Edge Node, you can have one or more devices.
  • Under each device, you can have any depth of folder/tag structure to represent the tags.

...


In our example, we have a single Edge Node of 'CLTEST002DIRECTOR', under it a single Device called PLC1, and under it, 15 registers in two different folders.  We could rearrange this by renaming and moving folders and tags to a different representation as desired.  The layout below is also valid as was done simply by moving/renaming the tags shown above.

 


Note while the folders and tags were moved and renamed, the required basic structure stayed the same with:

...

In this example we're usiing the default MQTT Server of MQTT Distributor:

Image Removed

Image AddedUnder the Transmitters tab, we're also using the defaults:

Image Removed

Image AddedNote the Tag Provider Name is the same Tag Provider we build out our Edge Nodes from in the Tag Browser earlier.  Now we can go back to Designer and force MQTT Transmission to update.  MQTT Transmission does not dynamically look for changes in the tag structure and update them.  If it did, you could end up with a lot of improperly structured data while the changes to the tag tree are being made.  So, the update must be forced via 'Refresh'.  This is a tag under the MQTT Transmission tag provider as shown below in the Tag Browser.

 


In order to refresh, Designer must be in read/write and preview mode.  Do so by selecting these two buttons in the top menu of Designer:

...