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

Compare with Current View Page History

« Previous Version 13 Next »

Prerequisites

Summary

This tutorial will provide step-by-step instructions for the following:

  • Installing the Ignition Gateway Industrial Application Platform with the Azure Injector Module
  • Configuring the Azure Injector Module to connect to Azure IoT Central
  • Publishing live tag data and events to Azure IoT Central

Upon completion of this module you will have an Ignition Gateway connected and publishing live Tag data to an Azure IoT Hub.

Tutorial

Step 1: Set up an IoT Central Application

Browse to Azure IoT Central. Then select the applications tab as shown below.

Click the 'Build an app' button in the middle of the window. Afterward, you should see the the following.

Click the 'Create app' in the Custom app tile window. This will open the following screen.

Modify the Application name, URL, and select a Pricing plan. Once all fields have been configured, click the 'Create' button at the bottom of the screen. Once complete, you should see your new application which should look similar to the following.

Now select 'Devices' on the left. You should see the following.

Now click 'New' in the upper area. Give the Device a name and an ID as shown below.

Make sure to note the 'Device ID' as this will be used later in the configuration of Azure Injector

Finally, click 'Create' to create the new device. When complete, it should look similar to the following.

Step 2: Download and Install Ignition

Ignition is an Industrial Application Platform that can be used to create SCADA and HMI solutions. A fully functional Ignition system can be downloaded and run in trial mode.

Go to the Inductive Automation download page and download the desired Ignition installer for Windows, Linux or MacOS;
https://
inductiveautomation.com/downloads/ignition

Once the Ignition installer has been downloaded, follow the instructions provided by Inductive Automation to install and startup Ignition.

Step 3: Download and Install the Cirrus Link Azure Injector Module

Go to the Inductive Automation download page again and select the 'Strategic Partner Modules' tab. Find the Cirrus Link modules section and download the Azure Injector Module.
https://
inductiveautomation.com/downloads/ignition. The download links should look similar to what is shown below.


Step 4: Configure the Azure Injector

Once you have Ignition installed and running, and the Azure Injector module downloaded, browse to the Ignition Gateway console (e.g. http://localhost:8088). Log in using the credentials that were provisioned during the Ignition setup process or some other valid credentials. 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 Azure Injector module from the file browser and install it. When complete, the Ignition Gateway Web UI module section should look similar to what is shown below:

Select the "AZURE INJECTOR" → "Settings" link on the lower left of the page to navigate to the Azure Injector Module's configuration page.  A detailed explanation of each configuration tab can be found here.  For this tutorial, we will only be adding a new Azure IoT Central Setting.

Click on the "Create new Azure IoT Central Setting..." link to bring up the following configuration form:


Set the following fields.

  • Setting Name
    • This can be any string that makes sense that represents this connection.
  • Enabled
    • Leave checked
  • Scope ID
    • This is found in the Azure IoT Central application view under 'Administration → Device connection'. It is labeled 'ID scope'
  • Password (Azure Enrollment Group Symmetric Key)
    • This is found in the Azure IoT Central application view under 'Administration → Device connection → 'SaS IoT Devices'. In the right pane are two keys. Either the primary or seconday key can be used for the connection.
  • Global Endpoint
    • Leave default
  • Provisioned Device ID
    • Use the Device ID that was provisioned in step 1 of this tutorial (as part of provisioning the Azure IoT Central application)

All other fields can remain default. Finally, click 'Save Changes' at the bottom of the configuration page. After a bit of time (about 30s or so) you should see the status go from 'Disconnected' to 'Connected' as shown below.

Also, in the IoT Central Application portal under devices you should see the device is connected.


At this point, a 'Tag Agent' can be used to get some data flowing into Azure IoT Central. By default when Azure Injector is first installed a 'Tag Agent' is created by default. This is shown below.

In order to use this Tag Agent to push data to IoT Central, we need to create a Tag Tree in Ignition. Begin by opening Designer. Instructions on how to do this can be found here. Note that link has a lot of information about Designer. For the purposes of this tutorial we're only going to be creating a Tag Tree with memory tags in the Tag Browser. So, not all of the information there is pertinent to this tutorial. Use Designer to create a tag tree as shown below with a single memory tag under the folder structure also shown.

In the tag browser change the Tag Provider from 'default' to 'Azure Injector'. Expand the 'Azure Injector Control' folder to show the 'Refresh' boolean tag as shown below.

Now click the Refresh boolean value to change it to true. This won't actually change the value of the tag but will tell Azure Injector to rescan the tag tree for any new tags that may have been added and to push them to Azure IoT Central. You may have to enable 'read/write' mode in Designer before this operation will be successful. Once the write is successful, you should see something similar to the following in Azure IoT Central's portal.

This includes the following data messages.

{
    "_unmodeleddata": {
        "topic": {
            "namespace": "spBv1.0",
            "edgeNodeDescriptor": "G1/E1",
            "groupId": "G1",
            "edgeNodeId": "E1",
            "type": "NBIRTH"
        },
        "payload": {
            "timestamp": 1638223073190,
            "metrics": [
                {
                    "name": "bdSeq",
                    "timestamp": 1638223073187,
                    "dataType": "Int64",
                    "value": 0
                }
            ],
            "seq": 0
        }
    },
    "_eventtype": "Telemetry",
    "_timestamp": "2021-11-29T21:57:54.067Z"
}
{
    "_unmodeleddata": {
        "topic": {
            "namespace": "spBv1.0",
            "edgeNodeDescriptor": "G1/E1",
            "groupId": "G1",
            "edgeNodeId": "E1",
            "deviceId": "D1",
            "type": "DBIRTH"
        },
        "payload": {
            "timestamp": 1638223073192,
            "metrics": [
                {
                    "name": "T1",
                    "timestamp": 1638223073192,
                    "dataType": "Int32",
                    "metaData": {},
                    "properties": {
                        "Quality": {
                            "type": "Int32",
                            "value": 192
                        }
                    },
                    "value": 12
                }
            ],
            "seq": 1
        }
    },
    "_eventtype": "Telemetry",
    "_timestamp": "2021-11-29T21:57:54.098Z"
}

The first message shows the 'NBIRTH' message which is an indication that the Sparkplug Edge Node has come online. The second message is a Sparkplug DBIRTH message denoting that a Sparkplug Device has come online along with its 'metrics' or tags, their metadata, and values. In this case we only had a single tag so that is all that is included in the payload.

Because Azure Injector is driven by tag change events, try writing a '10' to the T1 tag. This should result in a new DDATA message as shown below.

{
    "_unmodeleddata": {
        "topic": {
            "namespace": "spBv1.0",
            "edgeNodeDescriptor": "G1/E1",
            "groupId": "G1",
            "edgeNodeId": "E1",
            "deviceId": "D1",
            "type": "DDATA"
        },
        "payload": {
            "timestamp": 1638223663812,
            "metrics": [
                {
                    "name": "T1",
                    "timestamp": 1638223662800,
                    "dataType": "Int32",
                    "value": 10
                }
            ],
            "seq": 2
        }
    },
    "_eventtype": "Telemetry",
    "_timestamp": "2021-11-29T22:07:43.998Z"
}
  • No labels