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

Supplemental Videos

Description

Learn how to provide realtime Tag values through a database table using Transaction Groups.

Video recorded using: Ignition 8.1

Transcript

(open in window)

[00:00] In previous lessons, we saw how a transaction group can be configured to log tag information into a database for historization purposes. It is also possible to have a transaction group record real time tag information to a database. This means that as tag values change in ignition, the transaction group will update the database with the new values, rather than continuously insert new values into the database. Having the database continuously update with your tags real-time values, means that this tag data can be accessed by anything that has access to your database. Making, sharing tag data between two systems, quite simple. Let's explore what this will look like. Here I have a brand new standard transaction group named Tower One. I want this group to keep track of all my tower one's real time tag values here. To do that, I'll simply drag all my tower one tags into my group, like so, I will make sure my group is pointing to a valid data source or database connection, and I'll tell the group to write this data to a table named Towers, and I'll press Enter.

[01:19] This group will log real-time data, so for my table action, instead of inserting a new row into my tower's table with every group execution, I will tell it to update the first row like so. I will enable my group and save my changes. I can now click on the database icon next to my table name to have the database square browser show me my group's data in the database. Setting the database query browser to auto refresh, you will notice that with every group execution, the first record at my table, constantly gets updated with my tower one tags, real time values. What if I had more than one tower? Well, my tower one group is updating my tower tables first row as I have it configured here.

[02:08] If I wanted to log data for a second tower on this same table, I would first have to insert a new row into the table like so. I will require my tower's table to see my newly inserted row and notice how this new row has a new tower index of two, we will use this index shortly. Now I will create a new standard transaction group. I'll name it, Tower Two, and create it. I will grab the tags from tower two here from my tag browser, and just like before I will drag them over to my new groups OBC items table. I will configure its data source to point to my configure database, and I will tell it to write this tag data to my same tower's table. Now for the table action, I will also choose the update option, but instead of updating the first row, I want this transaction group to update the row that has a towers index of two.

[03:10] I will do so by selecting key value pairs here. I will add a new key value pair by pressing this button for my column cell, I want to select my towers index. For my value, I will set it two. This means that this transaction group will update the row in my towers table with a towers index of two. I will enable my group, save my changes, and I'll click on the database icon next to my table name once more to see my database data again. Setting the database query browser to auto refresh once more, you will notice that my tower one transaction group, is updating my towers tables first row. While my tower two transaction group, is updating the row with a tower index of two. Now just like I did here, I can have as many transaction groups as I want update an individual row in this tower's table.

[04:07] Since this tower's table is constantly updating with real time tag values, anything that has access to this database will be able to see this data as well.

You are editing this transcript.

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