Skip to end of metadata
Go to start of metadata

Prerequisites

  • Knowledge of Ignition and Module installation process: Cirrus Link Module Installation
  • Have Ignition 8.1.4 or greater installed
  • Install the following MQTT Modules into Ignition
    • MQTT Distributor (or have some other compatible MQTT Server set up)
      • v4.0.8 or later
    • MQTT Engine
      • v4.0.8 or later
  • Have an Edge Node such as Ignition with MQTT Transmission setup and connected to the MQTT Server.
  • Be familiar with information in this document: MQTT History

Abstract

Ignition and MQTT Engine supports the ability for Ignition Reference Tags to back-fill history in conjunction with Sparkplug Store and Forward capabilities. Using Reference Tags in conjunction with MQTT Engine can be useful especially when using UDTs at the Central Ignition Gateway. To use this feature you must be using Ignition 8.1.4 or greater. This tutorial describes how to configure both the Edge Node as well as the Central Gateway.

Central Ignition Gateway Configuration

Starting in Ignition 8.1.4 Ignition supports a feature to 'back-fill' historical data for tag providers. Normally if a tag is updated with a value that is older than the current value, Ignition simply throws it away. In doing so, no tag change event will ever fire and the tag will not be updated. This new option allows the value to be stored to the historical database if history is enabled on that tag. However even with this option enabled, it is important to note that no tag change event will fire. So, tag change event scripts, transaction groups, and any other subsystem that relies on tag change events will not be notified of the event if it is older than the current tag value (i.e. is historical).

To enable this option, browse to the Ignition Gateway Web UI → Config → Tag Providers → Realtime. Then select 'edit' for the Tag Provider that will contain Reference Tags that will point to MQTT Engine tags. Scroll to the bottom and click the 'Show advanced properties' checkbox. This will show the 'Allow Back-fill Data' option. Set it to true as shown below and then click 'Save Changes'.

Now, browse to the Ignition Gateway Web UI → Config → MQTT Engine → Settings → General tab. Scroll down and set 'Store Historical Events' to false as shown below.

At this point, reference tags can be created in the Realtime Tag Provider that point to MQTT Engine tags. If history is configured on the reference tag and historical data arrives at the MQTT Engine tag, those values with their appropriate timestamps will be stored in the historical database for the reference tag. Again it is important to note that 'tag change events' will not fire on the reference tag for all historical values that arrive and are stored to the database.

Edge Node Configuration

Historical back-fill will work with both in-order and asynchronous historical data arriving from the Edge Node. However, 'Store Historical Events' must always be set to 'false' in the configuration of MQTT Engine. Using each of these different has the following implications.

  • In-order history from the Edge Node
    • Historical data will be stored for the Reference Tag
    • If history is enabled on MQTT Engine tags, historical data will be stored the MQTT Engine Tag
  • Asynchronous history from the Edge Node
    • Historical data will be stored for the Reference Tag
    • Even if history is enabled on MQTT Engine tags, historical data will not be stored the MQTT Engine Tag. New values will only be stored in the historical database if it is a non-historical value.

In MQTT Transmission flushing in-order or not is controlled by the setting found here [MQTT Transmission Settings -> Transmitters -> [Your Transmitter… Default/Custom] -> Configuration -> In-Order History]. The following shows Transmission configured to flush in-order which will result in historical values to be stored in the historical database for both the MQTT Engine tag as well as the Reference tag.


Additional Resources

  • No labels