At the moment, if you have MQTT Engine connected to a device, and Ignition reference tags to reference the MQTT tags with history on, backfill data from MQTT doesn’t transfer to the reference tag if the connection to the MQTT device goes down.
If you enable history on the MQTT tag itself, then it backfills fine once connection to the MQTT device is re-established.
It would be great if this backfill data was transferred across to the tag(s) that reference it.
This is possible to impliment this via scripting,we have this feature working ,where the mqtt history of tag is backfilled and then is copied to any tag that references it.
So I updated to 4.0.9 from the Ignition modules download page and I can’t find the “Allow Back fill data”. Is there some version I’m not seeing? What version are you running of the engine and transmission?
OK, I’ve checked both boxes, and even restarted Ignition and still can’t get it to work. I’m just using the simulator on my desktop but running Ignition 8.1.11 and 4.0.9 of the plugins. To test it I just disabled the Engine which causes the Transmission to start storing the data. I let it sit for a bit and re-enalbed the Engine and my MQTT history fills in, but my tag referencing the MQTT tag never does.
I’m also experiencing some unexpected behavior when forwarding data to reference tags. It looks like I’m only getting 2 minutes of backfill. This graph shows the source tag (Blue) with all the forwarded data backfilled, a derived tag (Red) with none of the historical backfilled, and a reference tag (Green) with only two minutes of backfilled data. Is this a setting I can adjust somewhere?
I have gotten some clarity on this. The key is that all data should come into the system in chronological order. If that condition is met then all data will propagate to the correct history locations - including any reference tags that use that tag source.
If a data point comes into the system with a timestamp older than the current value’s timestamp you have two choices: 1. Ignore the timestamp and treat it like it is “now” data. 2. Enable back fill on the provider so that the timestamp is respected, but if it is older than the current value, it will only go into history and not update the tag value. That means that any reference tags that used that tag source will never see the value and therefore never make it into history.
So in summary - as long as the forwarded data comes in chronologically, everything will work by default (even without the backfill option enabled).
I have spent all too many hours over the years remembering how to get store-and-forward to work with Reference tags/UDT instances to not write this down. If anyone has corrections or suggestions let me know and I will test it out and update with my findings.
Steps necessary to get store-and-forward backfill into Reference tags i.e. UDT instances with references to MQTT Engine data source tags. Note, this may not work with expression or derived tags? MQTT Engine tags are ephemeral even though you have the option to enable history, make changes to settings, set alarms etc. Treat MQTT Engine tags as data sources similar to browsing OPC data.
Main Ignition
Tags
○ UDTs and UDT Instance Reference tags: Enable tag history (obviously).
All Tag Providers
○ Allow Back-fill Data: In advanced settings, enable "Allow Back-fill Data" which can allow data to come in out of order.
MQTT Engine
○ (Required) DISABLE "Store Historical Events". This is a common error as one would assume storing historical events would be a good thing. If enabled it will backfill store-and-forward data directly to the DB for MQTT Engine tags… if history is enabled on said MQTT Engine tags. This will NOT pass data on to Reference tags pointing to the MQTT Engine tags. You can prove this by enabling history on the MQTT Engine tag and trend it alongside the Reference tag.
Ignition Edge
MQTT Transmission History
○ (Optional) Edit your "Default In-Memory Store" and set it to be "Disk Backed". This is a good idea as your edge node is likely memory constrained.
MQTT Transmission Transmitter Settings
○ Discovery Delay: (Optional ) 10,000. Maybe a good idea if your consuming Ignition system has a lot of tags.
○ History Store: (Required) Select a history store
○ Enable History Storage by Default: True
○ In-Order History: (Optional) With "Allow Back-fill Data'" enabled in the tag providers this option is not required.
Thank you!
However, what if we have history enabled directly on some incoming MQTT tags, but for other mqtt tags we use reference tags with history enabled. Wouldn't this cause a conflict with "DISABLE "Store Historical Events"." ? Meaning that you can either have store and forward working with either reference tags or directly MQTT tags.
For what it's worth, I never use MQTT tags directly and use only reference tags to refer to the MQTT engine tags. If you standardize on one way or the other it simplifies things.
Are there settings on the tags in reference provider that needs to be set in order to optimize store and forward? We were ones told to have these settings in order to optimize receiving store and forward.