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
Take Topic Challenge
LESSON
Recipe Group
Description
Learn how to build a recipe system using Standard or Block Transaction Groups. Recipe groups use bi-directional communication to pass database information to the PLC when requested.
Video recorded using: Ignition 7.9
Transcript
(open in window)[00:00] Transaction groups provide a great way to build recipe management systems in Ignition. You can use the database to store a virtually unlimited number of recipes, and then build editing screens inside of Ignition, or on third-party tools, and then link them to the PLC using the DB to OPC mode of a transaction group. For example, we'll create a mock recipe system that has four set points. And we'll have a tag that selects which recipe we should load. In the database, I've already created a recipe table and populated it with values for each recipe. So we'll create a new standard transaction group. We'll drag in all of our tags that we're going to use and we'll mount them to the appropriate columns. For the recipe ID, we'll leave it as read only, but for the rest of the items, we'll map them to the columns that already exist in the database. My table name is called "Recipes," and we'll set the update mode from DB to OPC. Essentially what we're going to do here is select the current recipe based on the tag, and then load the values from the database to the PLC. My table uses a custom index called "Recipe ID." Now, to select the specific recipe we want, we're going to write a custom WHERE clause. Selecting where recipe ID equals, and now we're going to reference our dynamic tag. That's really all there is to it. When the group runs, it will run the custom WHERE clause, looking at the row specified by our current recipe tag. If any of the values are different, then we'll write them to our setpoint tags. If we enable the group, we can see this in action. If we change our current recipe number, say to five, the group runs and writes all other values down to the setpoint tags. We can do this a few more times to see the effect. That's really all there is to it. You can use more complicated triggers in order to only load on demand, or you could use a block group, or a store procedure group, to get data from the database in a different format. Once again, the database is a great place to store recipes, as it gives you virtually unlimited memory and greater flexibility for managing the data.