IoT Publish – Data Route

Publish Tag Values to IoT Cloud

View the following steps to enable Tag Publish feature to Kafka Brokers, MQTT Brokers, Azure IoT, and AWS IoT Gateway.

View the following video for a complete demonstration of how to publish data to Kafka Brokers, MQTT Brokers, Azure IoT, and AWS IoT Gateway.

  • 00:00 – Introduction
  • 00:23 – Set up Tags in OAS
  • 00:41 – Configure Azure IoT
  • 01:53 – Publish Selected Tags
  • 05:31 – Visual Studio Code
  • 08:00 – Step by step instructions
  • 08:12 – Bulk Publish to AWS IOT
  • 09:21 – Step by step instructions / Publish Data to AWS IOT Gateway
  • 09:33 – Bulk Publish to mqtt broker
  • 10:29 – MQTT Explorer
  • 11:20 – Step by step instructions/ Getting Started MQTT
  • 11:34 – Save button of the OAS Configuration tool

Step 1 – Configure Driver

Select Configure-Drivers to select Kafka, MQTT, Azure IoT, or AWS IoT Gateway depending on when destination you want to publish tag values to.

Configure Drivers

Step 2 – Define Tag Variables to Publish

Enable Publish Selected Tags at the bottom of the Driver configuration.

Select to publish data continuously at a specified interval, based on event, or at a specific time of day.

IoT Publish Type

If Event Driven browse for a local or remote OAS tag that will trigger the publish.  Select a Boolean tag that will change state from false to true, true to false, or both.  Or choose an Integer tag that trigger a publish anytime the value changes other than 0.

IoT Publish by Event

Enable Publish Latest Value Only to send only the latest value of each tag when published or disable to send all value changes since the last time a publish occurred.

Enabled Include All Tags Each Publish to send at least the latest value of each tag when published or disable to only send the tags that have changed since the last publish.

Enable Publish All Tags As One Topic to publish all tag values as one topic or disable to send each tag as its own topic.

IoT Publish Options

See Data Example at the end of this step for each selectable option.

Specify the Publish Topic Id if choosing to Publish All Tags As One Topic.

When publishing as one topic to optimize communications with Kafka multiple messages are sent for each publish when the number of tag value changes exceeds the Max Tags Per Publish limit.

Max Tags per Publish

Specify the Tag Id, Value Id, an optional Quality Id, and Timestamp Id for each tag value that is sent.

IoT Publish Ids

When including the Timestamp Id also specify the timestamp format, use Custom to specify your own date and time format.

Specify local and remote OAS tag variables to include in each publish and specify the Id.  Value is the current value from the data source or you can select any of the over 600 tag variables of each tag to publish.

IoT Publish Tags

Optionally use CSV Export and CSV Import buttons to set up additional tags to publish using Microsoft Excel.

When selecting remote tags use Basic Networking syntax or Live Data Cloud syntax in the tag path.

Select Apply Changes to begin publishing.

Data Examples:

Examples of publishing every 2 seconds with each tag value changing every second:

IoT Publish Options

Topic: oas_tags
{
  “values”: [
    {
      “id”: “Ramp”,
      “value”: 39,
      “quality”: true,
      “timestamp”: “2022-03-21T08:55:39.000Z”
    },
    {
      “id”: “Sine”,
      “value”: 0.8090169943749475,
      “quality”: true,
      “timestamp”: “2022-03-21T08:55:39.000Z”
    },
    {
      “id”: “Random”,
      “value”: 10,
      “quality”: true,
      “timestamp”: “2022-03-21T08:55:39.000Z”
    }
  ]
}
 
IoT Publish All Value Chagnes
 
Topic: oas_tags
{
  “values”: [
    {
      “id”: “Ramp”,
      “value”: 16,
      “quality”: true,
      “timestamp”: “2022-03-21T09:03:36.000Z”
    },
    {
      “id”: “Sine”,
      “value”: 0.587785252292473,
      “quality”: true,
      “timestamp”: “2022-03-21T09:03:36.000Z”
    },
    {
      “id”: “Random”,
      “value”: 96,
      “quality”: true,
      “timestamp”: “2022-03-21T09:03:36.000Z”
    },
    {
      “id”: “Ramp”,
      “value”: 17,
      “quality”: true,
      “timestamp”: “2022-03-21T09:03:37.000Z”
    },
    {
      “id”: “Sine”,
      “value”: 0.6691306063588583,
      “quality”: true,
      “timestamp”: “2022-03-21T09:03:37.000Z”
    },
    {
      “id”: “Random”,
      “value”: 26,
      “quality”: true,
      “timestamp”: “2022-03-21T09:03:37.000Z”
    }
  ]
}
 
IoT Publish Tag Id Topics
 
Topic: Ramp
{
  “value”: 35,
  “quality”: true,
  “timestamp”: “2022-03-21T09:07:15.000Z”
}
Topic: Sine
{
  “value”: -1,
  “quality”: true,
  “timestamp”: “2022-03-21T09:07:15.000Z”
}
Topic: Random
{
  “value”: 83,
  “quality”: true,
  “timestamp”: “2022-03-21T09:07:15.000Z”
}

Step 4 – Save Configuration

Select the Save button on the toolbar at the top.

Save

If this is the first time saving you will be prompted to make this the default configuration to load when the OAS Engine restarts.

This can be changed under Configure-Options-Default Files.