Versions Compared

Key

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

Prerequisites

  • Ignition with the Azure Injector Modules installed
    • Azure Injector Module 8.1.10 or later is required
  • Knowledge of Ignition and Module installation process: Cloud and MQTT Module Installation.
  • Ignition Designer installed
    • Review the Inductive Automation documentation for Launching Designer against the Ignition gateway
  • An existing Microsoft Azure account

...

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

...

  • Configuring the Azure Injector Module to connect to Azure IoT Central
  • Publishing live tag data and events to Azure IoT Central

...

Step 1: Set up an IoT Central Application

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

Image Removed

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

Image Removed

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

Image Removed

Follow the instructions in the Microsoft IoT Central How-to Guide for creating an IoT Central Application

Step 2: Set up a Device

Follow the instructions in the Microsoft IoT Central How-to Guide for adding a device to your Azure IoT Central application

Once configured, the device 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.:

Image Removed

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

Image Removed

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

Image Removed

Image Added

Note
Info
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.

Image Removed

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.

Image Removed

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:

Image Removed

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:

Image Removed

Step 3:  Record Security Permissions needed

From the left hand menu bar under Security > Permissions > Device connection groups, record the "ID scope" as this will be used later in the configuration of Azure Injector.Image Added

From the left hand menu bar under Security > Permissions > Device connection groups > SAS-IoT-Devices > Shared access signature (SAS), record either the "Primary key" or "Secondary key" as this will be used later in the configuration of Azure Injector.Image Added


Step 4:  Configure the Azure Injector Module

Once you have Ignition and the Azure Injector Module installed and running we can setup the configuration to connect to your existing Azure IoT Central endpoint.

Tip
Review theAzure Injector Module configuration guide for more details on each tab


Navigate to the Azure Injector Modules configuration section from the left side bar in the Ignition Gateway and select the Azure IoT Central tab.Image Added

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 the ID scope recorded in Step 3
    • Found under Security -> Permissions -> Device connection groups and 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 the Primary key or Secondary key recorded in Step 3
    • Found under Security -> Permissions -> Device connection groups -> [SAS-IoT-Devices] -> SAS -> Primary key or Secondary key. Either 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 This is the Device ID that was provisioned in step 1 of this tutorial (as part of provisioning the Azure IoT Central application)Step 2 of this tutorial 


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.

Image Added

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


Now the Azure Injector module is connected to the MQTT server in Azure IoT Central, we have to determine if there are are changes needed to the Tag Agent tab to be able to push data.

If you already have Ignition tags defined, for example from the Ignition OPC UA Server, then depending on the depth of your tag tree you may need to configure the Sparkplug Settings.

Tip
Review the Cloud Injector Tag Agents and Tag Trees document which describes how Cloud Injector Agent configurations interact with Ignition tag trees to push messages and tag change events to the cloud service. It explains how tags get identified to be pushed as well as what specific 'topics' will be included with the messages. It also goes over some example configurations to show how the system will behave in different scenarios.

Once the Tag Agent is setup as needed, you can jump to Step 6: Publishing data.

If you do not have Ignition tags defined we will do that in the next step with a tag tree depth that requires no additional Sparkplug settings.

Step 5: Create tags to be published in Designer

When the Azure Injector module is installed in Ignition, an Edge Node folder is automatically created in the 'default' Ignition tag provider.

Image Added

Create a tree structure under this folder as shown below with some memory tags - this folder structure creates the same hierarchy that is described in the Sparkplug B specification of Group ID, Edge ID, and Device ID.

Tip
Refer to the Ignition Tag Browser and Creating Tags documentation for assistance in configuring Ignition tags

Image Added

Anchor
step6
step6
Step 6: Publishing data

When the Azure Injector module is installed in Ignition, an Azure Injector tag provider is automatically created. This folder will contain both information tags about the module's version and state, as well as control tags for refreshing the module and Tag Agents.

Make sure that the Ignition Designer has read/write communications turned on by selecting the Project/Comm Read/Write button highlighted in the image below.

Image Added

Tip
Review the Inductive Designer Interface documentation for additional assistance on setting the project communication mode


To refresh the default Tag Agent, open the folder "Azure Injector Control" and click on the Refresh Boolean. When this happens, the Tag Agent will scan the "Edge Nodes" folder and find the new Memory Tags that we have created, construct JSON payloads representing those tags with their current values and publish the payload to the Azure IoT Central endpoint that we have configured.

Image Added

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.


The Azure Injector Tag Agent will publish two JSON payloads to the Azure IoT Central endpoint. The format of these messages closely follows the Sparkplug B Specification's payload structure.

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, tag metadata, and values. In this case only a single tag is included in the payload.


Image Added

This includes the following data messages.

Code Block
{
    "_unmodeleddata": {
        "topic": {
            "namespace": "spBv1.0",
            "edgeNodeDescriptor": "G1/E1",
            "groupId": "G1",
            "edgeNodeId": "E1",
            "type": "NBIRTH"
        },
        "payload": {
            "timestamp": 1659458670039,
            "metrics": [
                {
                    "name": "bdSeq",
                    "timestamp": 1659458670039,
                    "dataType": "Int64",
                    "value": 0
                }
            ],
            "seq": 0
        }
    },
    "_eventtype": "Telemetry",
    "_timestamp": "2022-08-02T16:44:31.511Z"
}


Code Block
{
    "_unmodeleddata": {
        "topic": {
            "namespace": "spBv1.0",
            "edgeNodeDescriptor": "G1/E1",
            "groupId": "G1",
            "edgeNodeId": "E1",
            "deviceId": "D1",
            "type": "DBIRTH"
        },
        "payload": {
            "timestamp": 1659458670049,
            "metrics": [
                {
                    "name": "T1",
                    "timestamp": 1659458670049,
                    "dataType": "Int32",
                    "metaData": {},
                    "properties": {
                        "Quality": {
                            "type": "Int32",
                            "value": 192
                        }
                    },
                    "value": 12
                }
            ],
            "seq": 1
        }
    },
    "_eventtype": "Telemetry",
    "_timestamp": "2022-08-02T16:44:31.527Z"
}


Step 7: Force a data change

Because Azure Injector is driven by tag change events, try writing a '10' to the T1 tag. Do this by double clicking the T1 tag in Designer and updating the Value parameter.

This will result in a new DDATA message as shown below.

Code Block
{
    "_unmodeleddata": {
        "topic": {
            "namespace": "spBv1.0",
            "edgeNodeDescriptor": "G1/E1",
            "groupId": "G1",
            "edgeNodeId": "E1",
            "deviceId": "D1",
            "type": "DDATA"
        },
        "payload": {
            "timestamp": 1659462601542,
            "metrics": [
                {
                    "name": "T1",
                    "timestamp": 1659462601542,
                    "dataType": "Int32",
                    "value": 10
                }
            ],
            "seq": 2
        }
    },
    "_eventtype": "Telemetry",
    "_timestamp": "2022-08-02T17:50:02.771Z"
}



Excerpt Include
CLD80:FAQ: Ignition Modules
CLD80:FAQ: Ignition Modules
nopaneltrue
All other fields can remain default.