Industrial Automation Tech Note 53 - TNIA53
This document explains how to get Crimson 3.1 to talk to Inductive Automation’s Ignition SCADA using the Sparkplug MQTT Connector. It assumes a basic knowledge of Crimson and its operation. For more details on the Crimson Cloud Connectors, please consult the Crimson User Manual.
CR3000 HMIs / Graphite® HMI / Graphite Controllers
Use Case: Sparkplug Connector
Transferring tag data to Inductive Automation’s Ignition SCADA using Sparkplug.
Build 3106.000 or higher
For testing purposes, an outline database can be created as described in the Crimson Cloud Connectors: Creating an Outline Database Tech Note. The outline database will be referenced when configuring the connector.
Step 1 – Installing Java
Before installing the Ignition SCADA software, you must have a 64-bit Java Runtime Environment installed on your machine. The Oracle website has an unfortunate habit of installing the version required by your browser rather than that required by this application, so it is recommended that you perform the installation manually by visiting https://java.com/en/download/manual.jsp and referring to Figure 1 select the 64-bit Windows Offline installer.
You may have to reboot your system once installation has completed.
Step 2 – Installing Ignition
Visit the Inductive Automation website at https://inductiveautomation.com/ and click on Download Ignition, refer to Figure 2.
Click on the Download Ignition + Ignition Edge button, complete the registration form and press Download. Once the download has completed, launch the Ignition Installer. Step through the usual steps and when offered the chance, select fully-fledged Ignition in its Typical configuration. Allow the installation to complete and click Finish with the Start Ignition Now box checked.
Your default web browser should show something similar to Figure 3.
Make a note of this address or add it to your Bookmarks/Favorites as we shall be using it later.
Step 3 – Installing MQTT
Ignition does not come with MQTT functionality out of the box. To install the MQTT software, return to the Download Ignition webpage that we visited in Step 2 and scroll down to Third Party modules from Cirrus Link.
Referring to Figure 4, click on both the MQTT Distributor Module and MQTT Engine Module and allow your web browser to download them to a convenient location. This will typically be the default Downloads directory on your PC.
Once the downloads have completed, return to the local Ignition webpage that opened at the end of Step 2, shown in Figure 5.
Referring to Figure 5, click on the Configure option and enter the default credentials of admin and password.
Referring to Figure 6, from the left-hand menu, select the Modules option and scroll down to show the Install or Upgrade a Module option.
Referring to Figure 7, click on the Install or Upgrade a Module option to display the following.
Referring to Figure 8, click the Choose File button and select the MQTT Distributor module you downloaded earlier. Accept the license agreement, indicate that you trust the module’s digital signature, and allow the module to install. Repeat this process for the MQTT Engine module. Your modules page should now show something similar to Figure 9.
Referring to Figure 9, note the Cirrus Link Solutions section in the module list, and the presence of the MQTT Distributor and MQTT Engine settings link in the left-hand menu. The MQTT Distributor needs no configuration for our application so click on the MQTT Engine option to configure that module, and scroll down to the Miscellaneous section.
The only change required here is to uncheck the Block Node Commands box. This will allow Ignition to submit writes to our device. After unchecking the box, press the Save Changes button to commit the configuration.
Step 4 – Piercing the Firewall
The MQTT Distributor listens for MQTT connections on Port 1883 of your PC. To ensure that connections can be received, we must open a hole in the firewall to allow them through. The exact process varies between versions of Windows but is similar enough that you ought to be able to follow along. Start by pressing CTRL+ESC or the Windows key to open your Windows start menu and typing the first few letters of Firewall. This should allow you to open the Windows Defender Firewall.
Referring to Figure 11, on the left-hand side, select the Advanced Settings option and then select Inbound Rules.
Referring to Figure 12, on the right-hand side, select the New Rule option and indicate that you want to create a Port rule as shown in Figure 13.
Click Next, then referring to Figure 14, specify a TCP rule for port 1883 and click Next.
Indicate that the connection should be allowed, as shown in Figure 15, then click Next.
Enable the rule for all types of network as shown in Figure 16 and click Next.
As shown in Figure 17, name it MQTT 1883 and select Finish to create the rule.
Step 7 – Configuring the Sparkplug Connector
We are now in a position to configure and test the Sparkplug Connector. We shall be configuring it to push four of the data tags that we have created. The fifth tag will be used to display the connection status. Start by returning to the Communications category and select the Sparkplug MQTT settings in the Connectors section.
Referring to Figure 18, perform the following actions:
- In the Control section, set the Enable Agent property to Yes.
- In the MQTT Server section, set the Host Name 1 property to the IP address of your PC.
- In the Diagnostics section, set the Status property to Status.
The default credentials of admin and changeme match the defaults of the MQTT Engine.
Next select the Tag Data 1 tab, as shown in Figure 19:
Referring to Figure 19, perform the following actions:
- In the Control section, set the Tag Writes property to Enabled.
- Select the Data Tags category of the Resource Pane.
- Drag Tag1 through Tag4 into the Contents field in the editing pane.
You have now configured Crimson to push Tag1 through Tag4 to Ignition once per second. Press F9 to download the database to your device and check the Status tag on your display or via the web browser. A value of 4 should be displayed, indicating that the cloud connection has been established and that data is being pushed. A value of 0 typically indicates an issue with network connectivity or with DNS, while a value of 1 indicates that the server name was resolved but that the connection could not be established. A value of 2 indicates that you have define a primary application identifier in Ignition that does not match that in Crimson. A value of 3 indicates that the connection has been made, but that data has not been transferred. If you do not see a value of 4, check each item in this note carefully and ensure your Crimson configuration matches your Ignition settings.
Step 8 – Interacting with the Device
Now that we have configured Crimson to pass data to Ignition, we can view this data from the Tag Explorer within the Ignition designer. Return to the local Ignition webpage that opened at the end of Step 2 and select the Launch Designer button from the top right-hand corner. Depending on your browser and its configuration, the designer may open on its own, or you may be prompted as to the security of the download and then have to open the application manually from your download bar. You will eventually be shown a logon window similar to Figure 20.
Enter the default credentials of admin and password and press Login…
Referring to Figure 21, enter a new Project Name of Test and press Create New Project. The Ignition Design should open, see Figure 22:
If the Tag Browser window is not visible, enable it via the Panels option on the View menu.
Expand the tag browser to show…
- All Providers
- MQTT Engine
- Edge Nodes
- Crimson Devices
The data being transmitted by your Crimson device should be visible as in Figure 23:
To change a tag, double-click on its value, enter a new one and press Enter. The first time you do this, you will be prompted to switch the database into read-write mode. If the write does not succeed, check that you have writes enables in the tag set and that you unblocked node commands in the MQTT Engine.
It is the customer's responsibility to review the advice provided herein and its applicability to the system. Red Lion makes no representation about specific knowledge of the customer's system or the specific performance of the system. Red Lion is not responsible for any damage to equipment or connected systems. The use of this document is at your own risk. Red Lion standard product warranty applies.
Red Lion Technical Support
If you have any questions or trouble contact Red Lion Technical Support by clicking here or calling 1-877-432-9908.
For more information: http://www.redlion.net/support/policies-statements/warranty-statement