Ignition Module

The Ignition Module connection allows for browsing, reading, and writing tag data and UDTs to and from Ignition. The connection requires that the HighByte Ignition Module be installed on the Ignition server. For details on downloading and installing the module, please see the install section.

With the module installed in Ignition, the Intelligence Hub connects securely to the module using secure web sockets.

Connection Settings

Host

The IP address or domain name of the Ignition server.

Port

The port used to connect. By default the port is 45280. This port must be open and available on the Ignition server.

Token

The API token used to authenticate the connection. This is set in Ignition under the module configuration (see module installation).

Connect Timeout (seconds)

How long to wait for a connection before failing.

Request Timeout (ms)

How long to wait for a read or write to complete before failing.

Input Settings

Inputs can be tags, folders, or UDTs from any Tag Provider in Ignition. Inputs are polled. If a Tag Provider is changed, for example a tag is added or deleted, the module automatically detects this change and reflects the changes in the next read.

Tag Address

The full tag address, as defined by Ignition. This includes the Tag Provider and the path. The address can point to a tag, folder or UDT. When reading a folder or UDT, all child tags, folders, and UDTs are also read. Examples are provided below.

js
// Read a line and all child data
[default]/site/are/line
    
// Read a tag
[default]/mytag

// Read the entire tag provider    
[default]

Output Settings

Outputs can write to or create tag providers, tags, folders, and UDTs (both definitions and instances). Outputs automatically detect changes to a Tag Provider and reflect those changes on the next write.

Tag Address

The tag address to write to. This address must exist if Create is disabled, otherwise the write fails. Like inputs, the tag address must include the tag provider and full path.

Create

Enable this option to create tag providers, tags, folders, and UDTs if they don’t exist. See below examples of write payloads and how these map to the Ignition Address space.

Do not enable Create to write to existing tag providers that the Intelligence Hub has not created and does not own. In some cases this can lead to a loss of tags or UDTs in the existing tag provider.

Assume all the examples write to [myTagProvider] with Create enabled. If myTagProvider doesn’t already exist, it’s created.

The following write payload will create [myTagProvider]/myTag1 as an integer and [myTagProvider]/myFolder/mySubFolder/myTag2 as a string.

json
{
  "myTag1": 23,
  "myFolder": {
    "mySubFolder": {
      "myTag2": "hello world"
    }
  }
}

The following payload creates a UDT definition named “injection” with temp and cycleCount attributes. It also creates folder hierarchy for line1/area1 as well as two UDT instances named machine1 and machine2.

json
{
  "line1": {
    "area1": {
      "machine1": {"_model": "injection", "temp":  100, "cycleCount": 1},
      "machine1": {"_model": "injection", "temp":  75, "cycleCount": 20}
    }
  }
}

The following payload created a single “injection” UDT definition, and a UDT instance named “injection1”.

json
{"_model": "injection", "temp":  100, "cycleCount": 1}

Getting UDT Instances

The following transform stage example shows how to extract unique UDT instances from a branch read and generate unique events in a pipeline for each instance. This is useful for use cases that involve sending each UDT type to a unique table in SQL or Snowflake, or to a unique S3 bucket or Azure Blob, as examples.

js
findObjectsWithModel(event.value, "")

function findObjectsWithModel(node, path) {
    if (node && typeof node === "object") {

        // If it's a UDT instance it has #model metadata
        if ("#model" in node && node["#model"] !== "") {
            // Copy all attributes
            let newNode = {...node}

            // Add in add metadata
            newNode["name"] = node["#name"]
            newNode["model"] = node["#model"]
            newNode["path"] = path
            newNode["timestamp"] = Date.now();

            // Remove old metadata fields
            delete newNode["_name"]
            delete newNode["_model"]

            // Emit event for this UDT
            stage.setValue(newNode);
        }

        // Check hierarchy for more UDTs
        for (let key in node) {
            let newPath = path !== "" ?  path + "/" + key : key;
            findObjectsWithModel(node[key], newPath);
        }
    }
}