You can help by commenting or suggesting your edit directly into the transcript. We'll review any changes before posting them. All comments are completely anonymous. For any comments that need a reply, consider emailing training@inductiveautomation.com.
Version:
LESSON LIST
-
1:57Basic Historical Group
-
1:39Scheduled Group
-
3:28Realtime Group
-
3:59Bi-directional Group
-
4:02Stored Procedure Group
-
3:51Block Group
-
2:49Recipe Group
-
2:34Update or Insert Group
LESSON
Bi-directional Group
Description
Learn how to use bi-directional data synchronization to write from Tags to the database and from the database to Tags to keep a table with realtime values in the database.
Video recorded using: Ignition 7.9
Transcript
(open in window)[00:00] A bi-directional transaction group is any transaction group that is set to write bi-directionally from the database to OPC or tags. In other words, it's not a group that's inserting new values or new rows into the database. These types of groups can be useful in a number of cases, in almost every case, though you want to allow the changing of values to set points from multiple occasions, from inside of Ignition for example or from outside source talking directly to the database. In these cases, a bi-directional mapping can help keep both sides in sync. In our example here, we'll configure a simple group that uses bi-directional mode, to allow the changing in set points against the tank. We'll create a new standard group and then we'll bring in the values of a simulated tank. Here we have status like level and temperature and then we have set points, such as a temperature set point, a level set point and a valve control. In this case, we'll simply update the first row of a table. In reality we might have multiple rows and we might use a custom ware clause or key value pair to choose just row we want, but we'll keep it simple here, As the group is currently configured data would be mapped from the tags to the database but we want the values to go bi-directionally. We could choose to set the entire group to bi-directional mode. However, since we have only few tags that can actually be written from the database we'll set the mode directly on the items. We'll set the HOA to two set point values and the valve control. Now in this case, I'm selecting the first bi-directional option, the bi-directional OPC wins option. These two options dictate what happens if the value were to change at the same time on both sides. The so called OPC wins, which applies to tag references as well, Means that the value from the tag will be written to the database. Database wins of course means the opposite and if the value change on both sides at the same time the value from the database will be written to the tag. In my example here, I don't have a strong preference, but you'll have to consider which side you think should be the authority. To enable our group. We see that runs and we can view the values in the database. Here we have our temperature process value changing every second. Since, we have it mapped bidirectionally we can add to the 8P table and change the value of the set point. We'll change it to 150 and we apply the value we see down the next execution is written to the tag from the database. If we wrote the tag, we could then refresh the database and see that the value had been written in that direction. So you see bi-directional items in groups are very straightforward concept that can provide a great deal of flexibility and exposing data to two different sources as tags in Ignition or through the database to outside systems.