Versions Compared

Key

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

...

Table of Contents
maxLevel4

History Configuration Persistence  

Currently history configuration for MQTT Engine tags is not persistent and it may be required to delete MQTT Engine tags in certain cases. One example is UDTs which are being propagated from the Edge and the UDT definition on the Edge has been updated. This requires one to delete all instances of the UDT under MQTT Engine and delete the corresponding UDT definition so that it can be recreated/updated at MQTT Engine for the Edge side changes to take affect.

...

Alternatively you can use scripting to reapply the history configuration directly to MQTT Engine tags on demand


MQTT Engine Historical Event Processing

MQTT Engine has two ways to process historical events and insert the historical data into Ignition's Tag Historian module:

  • Writing historical events directly to the database, via the Historian, bypassing the tag
  • Writing historical events directly to the tag

Anchor
writetodatabase
writetodatabase
Writing historical events directly to the database, via the Historian, bypassing the tag

The configuration parameters required to write historical events directly to the database, via the Historian, bypassing the Tag are shown below.

MQTT Engine

Under the MQTT Engine Settings General Tab, navigate to the Miscellaneous Settings and ensure Store Historical events is selected

Tag History Configuration

History must be enabled on the tag (either directly on the MQTT Engine tag or reference tag) but the only property used from the tag history configuration is the Storage Provider.

...

Note
All other properties such as Sample Mode, Max Time Between Samples, Deadband etc are ignored when writing historic data

Edge Client

The Edge side client can publish historic data either in-order (synchronously) or asynchronously.

Tip

If you are using MQTT Transmission as the Edge side client, under the MQTT Transmission Settings for your transmitter, navigate to the History Settings to disable the In-Order History configuration parameter. Enabling the In-Order History for MQTT Transmission is unnecessary and will result in a waste of resources.  


Anchor
writetotag
writetotag
Writing historical events directly to tag

There are several reasons why you might need to write directly to the tag which include:

...

The configuration parameters required to write historical events to the Tag instead of directly to the Historian are detailed below. 

MQTT Engine

Under the MQTT Engine Settings General Tab, navigate to the Miscellaneous Settings and ensure Store Historical events is de-selected

Tag History Configuration

History must be enabled on the tag (either directly on the MQTT Engine tag or reference tag) with these two settings required:

...

Note
All other properties such as Max Time Between Samples, Deadband etc are ignored when writing historic data

Edge Client 

If you are not using reference tags, the Edge side client must publish historic data in-order (synchronously) before live data resumes. This is because because Ignition will ignore writes to the tag if the timestamp on the tag change is older that the current value.

If you are using reference tags and have the Ignition Allow Back-fill Data disabled on the tag provider that will contain the reference tags, the Edge side client must publish historic data in-order (synchronously) before live data resumes. This is because because Ignition will ignore writes to the tag if the timestamp on the tag change is older that the current value.

If you are using reference tags and have the Ignition Allow Back-fill Data enabled on the tag provider that will contain the reference tags, the Edge side client can publish historic data either synchronously or asynchronously. Using each of these different flush methods has the following implications:

...

Tip

If you are using MQTT Transmission as the Edge side client, under the MQTT Transmission Settings for your transmitter, navigate to the History Settings to select or deselect the In-Order History configuration parameter.

As shown below, when the MQTT Transmission client comes back online and flushes history, it will flush the oldest historical events first (in order) before sending live Tag changes events to Engine. 


History Configuration Examples

Sample Mode = On Change, Min Time Between Samples = 0, Max Time Between Samples = 0

  • Suitable for writing historical events directly to the database or writing historical events directly to the tag
  • Real-time data is written to the storage provider on each tag change event whilst the tag quality is Good
  • Historical data is written to the storage provider or tag using the timestamp associated with the historical data 
    • Handles historical metrics flushed from the Edge that have very high resolution; e.g., the historical metrics have timestamps 1 ms apart for a single tag

Sample Mode = On Change, Min Time Between Samples = 0, Max Time Between Samples = 5

  • Suitable for writing historical events directly to the database or writing historical events directly to the tag
  • Real-time data is written to the storage provider on each tag change event whilst the tag quality is Good
  • Real-time data is written to the storage provider on the Max Time Between Samples interval if no tag change events whilst the tag quality is Good
  • Historical data is written to the storage provider or tag using the timestamp associated with the historical data 
    • Max Time Between Samples inserts will not be inserted into the middle of historical data
    • Handles historical metrics flushed from the Edge that have very high resolution; e.g., the historical metrics have timestamps 1 ms apart for a single tag

Sample Mode = Periodic, Max Time Between Samples = 0, Sample Rate = 5

  • Suitable for writing historical events directly to the database
  • Real-time data is written to the storage provider on the Sample Rate whilst the tag quality is Good
  • Historical data is written to the storage provider using the timestamp associated with the historical data






Anchor
backfill
backfill
Ignition Allow Back-fill Data

Starting in Ignition 8.1.4 Ignition supports a feature to 'back-fill' historical data for tag providers.

...