Versions Compared

Key

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

...

  • Installing the Java Runtime Environment
  • Installing Ignition
  • Installing the following MQTT Modules
    • MQTT Distributor
      • v1v2.71.0 or greater X if using Ignition 7.7.x or 7.8.Xx
      • v1v3.81.0 or greater if using Ignition 7.89.X
    • MQTT Engine
      • v1v2.71.2 or greater X if using Ignition 7.7.Xx or 7.8.x
      • v3.1.0 v1.8.2 or greater if using Ignition 7.89.X
    • MQTT Transmission
      • v1v2.71.0 or greater X if using Ignition 7.7.x or 7.8.x
      • v3.1Xv1.8.0 or greater if using Ignition 7.89.X
  • A device that supports Modbus over TCP

...

Transmission is an MQTT module for Ignition that can convert Ignition Tag tag data and tag change events into MQTT messages to be consumed by MQTT Engine or other MQTT clients.  This basic tutorial will show how to configure MQTT Transmission to send OPC Tag 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:

The first step is to configure the Tag Provider tag provider in Ignition in a way that MQTT Transmission understands.  Start by configuring your OPC server, client, and tags.  This can be done using the Inductive Automation documentation here.  Once this is done, the Tag Provider needs to be set up in Ignition via the Ignition Designer.  Using a Web Browser, browse to the Ignition Gateway on your Ignition Gateway.  If it is running on your development machine, that is: http://localhost:8088.  You should see this:

Image Removed

 Image Added

Near the upper right corner, click 'Launch Designer'.  This will open the following window after downloading the .jnlp JNLP file and executing it.  Note the default username/password is admin/password.  Type those into the appropriate fields and click 'Login'.

Image RemovedImage Added

 

This will bring you to a new Window where you can select an Ignition Project or create a new one.  Create a new project by giving it a name and clicking 'Create New Project'.

Image RemovedImage Added

 

 

In this example we're going to use the '"default' " tag provider within Ignition EnterpriseDo so by expanding 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:

...

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:

...

With our tags set up as we want them, we now must configure MQTT Transmission.  Do so by browsing to the the Configure section of the Ignition Gateway web UI and selecting 'MQTT Transmission -> Settings' on the left: 

                                                                                                                               Image Removed

 

Image Added

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

Image RemovedImage Added

Under the General Transmitters tab, we're also using the defaults:

Image RemovedImage Added

Note 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.  This is because if 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.

...

Once this is done, click 'Refresh' in the Tag Browser.  This will force MQTT Transmission to read the default Tag Browser tree, find 'Edge Nodes', and begin creating the components needed to send sending MQTT messages based on tag change events.  You can see this by clicking the refresh icon in the Tag Browser menu:

...

In addition to the tags being displayed in Engine, they are also writable if this enabled in MQTT Engine.  By default, MQTT Engine blocks command messages from being sent to devices.  To enable this feature, in the Ignition web console browse to the MQTT Engine Module Configuration and make sure 'Block Commands' is not checked Settings.

Image Added

Make sure the "Block Node Commands" and "Block Device Commands" settings are disabled, as shown below:.

Image RemovedImage Added

With this enabled and Designer in read/write and preview mode, you can write to the outputs of the modbus device from the Tag Browser:

...