This lesson is part of the Tag Historian in Ignition course. You can browse the rest of the lessons below.


Autoplay Off
Take topic challenge

Supplemental Videos


Displaying Tag History


Components in both the Perspective and Vision modules can retrieve records collected by the Tag Historian system. In this lesson we demonstrate how this process works.

Video recorded using: Ignition 8.1


(open in window)

[00:00] The Tag Historian system logs data to a database of your choice. Ignition then offers features to be able to read this data back for visualization purposes. Using either perspective or vision modules Tag Historian data can be displayed on tables, charts among other components using tag history bindings as well as built-in functionality within some components. In this lesson, we will cover tag history bindings and some of the built-in features some visualization components have to display tag history data. We are currently in our designer. I want to visualize my historical data in a chart. I am currently looking at a perspective view named myview. From my perspective component palette. I will grab a power chart and drag it onto my view. I can then put the designer in preview mode and press the little tag button on the upper left hand quarter of my power chart. Doing so we'll expose a tag browser that will allow me to browse through all of my historical tags.

[01:08] First, I have to choose which database I want to get my data from. My database is called training. I then have to select which gateway and from which realtime tag provider my tags are coming from. Finally, I can browse through and select which tags I want to trend. I can either select one tag or I can press and hold the Control key to select multiple tags. Once I'm happy with my selection, I can press the add selected tags button and I will begin to see my tag data trended on my power chart. I will hide my tag browser by pressing this button here and if I click on the little calendar icon on top of my chart, I can select the amount of time I want to see data for or I can give it a start and end date as well in historical mode. Down on the bottom, I get a small table which shows me which tags I am currently trending data for. I can choose to delete this tag from my trend or I can choose to edit this configuration by pressing the little pencil next to it.

[02:06] Here, I can change the name of my line, give it its own plot or axis, changes its color, aggregation mode among other things. So with just a few clicks, I can select which tags I want the trend and the power chart will query the database for historical data and begin trending it. That is one example of a components built in features to display historical data. I can also grab something like say a table from my perspective component palette. This components data is driven by a state data property which we can see here on the property editor on the right. If I want it to display historical data on this table, I would have to configure a tag history binding on this table's data property. To do that, I will click on the binding icon next to the data property and select the tag history binding type on my binding editing window. This will bring on my tag history bindings configuration which allows us to configure how I want this binding to query for historical data.

[03:08] First, we see the return format. Wide format means the query will return a column for every tag we are querying for along with a timestamp column. Tall means that the query result will have columns for value, quality, timestamp and tag path for each tag we query and each row in my query result is a new tag value at a specific time. The calculations option just allows you to perform calculations on the return data before it goes into our table. Query mode allows me to specify how many rows I want my history query to return. With pointcount, I can tell the system to only ever return say 100 points or a single point if I want it to. With periodic, I can tell the system to return a record for every period of time within my query specify time range. Asstored query mode will return the historical data as it was stored in the database.

[04:05] My time range can either be real time where I can specify how recent I want my historical data to be or I can do historical mode where I can specify a start and end date for my historical queries time range. I can also define my binding to pull at a specific rate if I wanted to. Now I can select which tasks I want to query history for. To do that, I can click on this little tie icon and drill down and find all the tags I have tag history configured for. In my case, I will select Ramp0 and press okay. Once my tag is added, I can give it an alias or configure an aggregation mode to be applied to my query result. Say I only want to see my Ramp0 tags average value, I can do that. Before I finished my configuration though, I want to talk about my bindings options here above my preview. First I can choose to enable, disabled my binding and I can choose to opt out of any warning or error overlays associated with this binding itself.

[05:06] I can also tell the binding to ignore any bad quality data logged by the historian and I can tell the binding to prevent any interpolation of my historical data. You will also notice the binding preview down at the bottom has updated to show me a preview of the data my query will return. I will now click OK to exit my configuration and I will see my table was showing a single value for the past one hour representing my Ramp0 tag average value. I also have to add two new column objects to my table component. To do that, I head over to its columns property and click the little blue plus sign to add a column object. I have two columns on my table so I will add a second column object like so. I will then set my zero with columns field property to t_stamp and set its dateFormat to something a bit more suitable. Now I can set my first column objects field property to Ramp0 and I am finished with my configuration.

[06:08] This is one example where we can use tag history bindings to retrieve information from our Historian.

You are editing this transcript.

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


Share this video