Learn how to mirror Tag history data to two databases.

Video recorded using: Ignition 7.9


(open in window)

[00:00] In this lesson we'll take a look at the tag history splitter. When configuring tag history, you can only select a single historical provider. For example I'm in the tag editor here and there really isn't an interface to select both of these providers simultaneously. But in some scenarios you may wish to push the historical data to two separate historical providers. Say you had a local database and a central data center somewhere and you wanted to push the data to both simultaneously. That type of scenario is exactly what the tag history splitter was designed for. To start with let's go ahead and create the tag history splitter, so I'm actually going to close my tag editor for right now and I'm going to bring up my gateway. And just so you can see where I am, I am in the Configure section. If I scroll down just a little bit, under Tags and History, and we have our two historical providers already, but I'm going to click this Create New Historical Tag Provider link down below. And I'm going select the Tag History Splitter provider. We'll click Next again. Let me give this a little name here, so how about just "Splitter", something I can recognize it with. And if I scroll down a little bit further here we'll take a look at the settings. And we'll start in Storage. So when a tag uses the splitter provider here, we need to specify which two other historical providers we want to push the history to. So in my case, I'm going to go ahead and for my first connection choose DB1 and my second connection DB2. Now from the storage perspective, as you can see from the little note here under First Connection, we'll push the data equally to both connections. The order of your connections really only matters when we're talking about retrieving the data. By default we only run queries against the first connection. However, down below in this little Querying section you can enable the Limit First Connection Query. And when you do, this provider starts paying attention to the limit length and limit units down below. These settings specify a maximum range of time for queries on the first connection. Any data that falls outside of this range will run against the second connection. So with the settings I currently have, if a user has a client open somewhere and they have a chart, and they're looking at the most recent two months' worth of data on a tag using this provider, data points from within the first month will run against the first connection here. Anything outside of that range or further back in time will run against the second connection. So I can actually have multiple historical providers and potentially multiple databases working together to fetch tag history data. Furthermore, limiting queries allows you to make clever use of the prune settings on each connection, meaning you could treat the first connection as short-term storage and configure the historical provider to use a short prune age while treating the second connection as long-term storage by disabling pruning on that historical provider. So I'm going to leave my settings as is for right now, and I'm going to click the Create New Historical Tag Provider button. We can see that it created the splitter provider so now I'm going to head back to my designer. I'm going to enable history on one of my tags here so I'm going to double click on my Sine0 tag. Back in the history section, I'm going to say yes I want to store history. And if we take a look at this History Provider dropdown, we can see that the splitter provider is now an option. So if I select that, whenever we take a tag history reading from this Sine0 tag, the history will be stored to both my DB1 and DB2 historical providers.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.


Share this video