This lesson is part of the Building in Perspective course. You can browse the rest of the lessons below.

LESSON LIST

Autoplay Off

LESSON

Creating Tags

Description

In this lesson we'll take a quick look at Ignition's Tag system, create a UDT definition, and set up several UDT instances.

Inductive University Lesson: Tags in Ignition
Inductive University Lesson: Understanding UDTs
Inductive University Lesson: UDT Inheritance

Transcript

(open in window)

[00:00] Welcome back. Now it's time to create some ignition tags. So in a previous video, we created a simulated device configuration but now we need to actually go ahead and retrieve the values from that device. Then we can start building our screens with them. It will take a moment to talk about the tag system and ignition. When you're in the Designer here, you interact with the tag system from the Tag Browser on the left-hand side here. Now, when you first get into the Designer the Tag Browser is actually set to the Tags Tab we do have this sort of UDT Definitions Tab that you can switch back and forth between. We'll see what that does in a little bit. But let's start off on the Tags Tab. Now the device simulator we're using is great because it's actually browsable. So we can actually go ahead and just drag and drop the data points we want into the Designer here. From the Tag Browser here, we'll hit the little plus dropdown and we'll select Browse Devices.

[01:00] And then we'll get into this little Tag Creator window here. On the left-hand side, we do have a list of connected things that our gateway has access to. Under Ignitions OPC UA server, we'll expand it. We'll go to the device's folder and we do have our BIP_Simulator. And if we go inside of there, we do have a bunch of folders including some folders for these various stations. And you can see that they have kind of a similar sort of structure to them. What we can do here is I'm going to take Station one just a folder, and I'm going to drag that to the right-hand side. And you can actually get a little preview here on the right-hand side. It's going to create Station one folder and then it's going to create tags for all of the items under that folder. Let's go ahead and click Okay. And we see, we have Station one expand that we have some moving numbers from our simulator. We could go ahead and just drag Station two and three and be done. That's actually a very quick way to handle it but I actually want to go ahead and turn these stations into a UDT. So that's what this UDT definitions thing is referring to over here.

[02:01] So a UDT or a user defined type is sort of like a Tag structure. Instead of having like a one-off tag like the single viscosity tag here we can actually create a whole sort of repeatable structure. The main benefit of doing that is it makes a little bit easier to sort of maintain your tag system. UDTs have aspects of inheritance so you can make changes to a definition of a UDT. And then those changes will be propagated down to all instances. Kind of nice if you needed to make changes later on which will end up wanting to do in future videos. What I'm going to do for now, is I'm actually going to select the Station one folder and I'm going to Right-click and just delete it just to get rid of it because we'll go ahead and we'll create stations. All of our stations actually will represent them as UDT instances. To begin, we need to create a definition. I'll click on the UDT definitions Tab here and we'll go back that little plus drop down which does change its contents, depending on which of these two Tabs you have selected.

[03:04] So under UDT definitions, little plus down and we'll create a New Data Type. We have this little Editor window here where we can basically go ahead and define our definition. The idea is that your definition is at the routes and then you place additional tags under it. Now, what we can do here from this little type structure area on the left-hand side, if you look a little icons that are just to the right of it, third from the bottom should be a little box. It's actually a little device item or icon there. I'm going to click on that. And it's going to open up this connected devices tree which is pretty similar to the tag creator's tree we saw earlier. I'm going to expand ignitions OPC UA server. We'll go to devices, we'll go into our simulator. And then for Station one, I'm actually going to expand it. And instead of selecting the folder, I'm going to select ph, I'm going to hold Shift. And then I click on viscosity, which should select all of those tags there. And then I'll click Add and it should Add all of our tags under this New Type here.

[04:05] Let's go ahead and Select the route item, the top item there, the one that just says New Type, and I'm going to change its name property here. We'll just call this Station. Now, we do have a lot of videos here on Inductive University about tags and UDTs and how they all work. I'm not going to spend a lot of time talking about them but I'll summarize real quick, just so we're all on the same page here. When I'm looking if I were to click on one of these members that are inside of the UDT or one of these sort of sub items here if we look over on the right-hand side there's this OPC Item Path property. This property here tells the tag where it should get its value from. So in this OPC server, from all of the devices or whatever's connected to the OPC server where should this tag get its value from? For the OPC Item Path here if I were to click this little Edit button or this little link button on the right-hand side and then I click Edit we can see the path kind of looks something like this. It basically has like the device name and it has some namespace stuff to the left of it.

[05:03] But then after the device name and square brackets it has station_1 and then /ph. And this path here actually matches what's in the little instructions CSV that we loaded into our simulator program. So it knows, okay, go to the simulator, go to Station one and inside of there, there should be a ph value. That's what this tag is going to represent. Really we could actually replace the one here with a Parameter. And what that means is later on when we're creating instances of this station definition we can actually provide different parameter values to different instances and then different instances can go get the values of different items within our device. I'm going to actually revert from here for now . And I'm going to go back up to station. So that route item there and under Parameters we're going to add a parameter. So for parameter I'ma click the little pencil icon here which then takes us to a table. I'll hit the little plus button here which adds a row to the table and with the name parameter that we're going to use.

[06:04] I'm going to double click on the name cell there. I'm going to get rid of new parameter and you can use spaces here but I'm just going to use underscores here. I'll create a parameter called station underscore number. I'll hit Enter to Commit it. We can leave the data type as an integer that's fine. Now the value here, we could type in something I'm actually going to leave this blank. The idea is on this little station UDT, we're making. It's sort of the copy or the master copy. It's the blueprint that all of our instances are going to adhere to. If I set a value here, I'm basically saying, "Hey use whatever value I typed here as the default." I'm just going to leave it blank. Doesn't really matter. It will be set we're going to override this later on instances anyways but no real point in setting a value here now either. I'll click Commit. Now we have one parameter that lives inside of station and then all of the members inside of station are allowed to reference the value of parameter. This next part here, we're going to go ahead and do a little Copy and Replace. I'm going to Select ph here and for ph, we're going to go back to that OPC Item Path and I'ma click the little link button there, will Edit, and it might help to zoom in here.

[07:15] I already zoomed in a little bit from practice earlier here but if you hold Control and scroll your mouse wheel, you can actually increase the text size here. Now I'm actually going to replace the one there. I'm going to actually just delete the one. And then with the cursor at the same spot, I'm going to click the little button on the right hand side which gives me a list of parameters. And you can see that we have station number here. There's a bunch of other built-in parameters too, but for station number, I'm going to go ahead and just select that. And I'll actually type it in there with some notation for us. For the next part we just basically need to do that exact same thing for the rest of our tags here. It's going to be a little bit of copy and pasting. I'm actually going to select everything. That's just to the left of that final slash there. And I'm actually going to copy that. And I'm just going to go ahead and Paste that path since that's going to be the same well I want that to be the same for all of the other members inside of this UDT. With that copied, I'll hit Commit, I'll select Pump_faults, I'll click the link button or icon, I'll click Edit, and I'll just select all the texts to the left, Right-click and Paste.

[08:22] And I'm just going to go ahead and hit Commit again and I'm going to do that for the rest of these. And I'll actually speed this part up because it's actually pretty straightforward. It's just the same action over and over again. No reason for you to have to watch me do it, but you'll want to do it on your end. I'm all done there. What I'm going to do now is I'm going to hit, Okay or press, Okay, what should apply the changes and actually create the UDT which we can see again, we're under UDT definitions. If I were to expand this, we do see all of our members. We don't see values because UDT definitions they're not technically executing I guess, this is the way you could say it. They're not retrieving any values at this point. It's just like a configuration that's stored we need to create a copy of this before we have any sort of live value. You create the copies under the Tax Tab. We'll switch back over. We'll go back to the little plus dropdown here. Now this time, instead of browsing devices like we did before where we just wanted to create, like one-off tags we go down to data type instance and we have our station which is the only one we have right now.

[09:25] So we'll click on that. And that opens up this Tag Editor. Now this is actually configuring an instance of that instance, points of new instance. So in this case, I want this to actually be Station one. I'm going to actually change the name here again with the kind of loop or the top level items selected. We'll go to the name property, and instead of a new instance, station underscore one, I'ma hit enter to Commit that. And if we go to the parameters area here, for parameters, if I were to hit the little pencil icon we have station number. Here's where we can set a value since we're on an instance right now we're creating an instance. Here's where we set a value of say one which I'll hit Enter. I'll click on Commit. That means for all the members here inside of this one instance it's going to look at the value of that parameter. And it's going to apply that to the OPC item path for each one of those members. If I did everything correctly, I can click, Okay here, we can see that I have my instance of Station one.

[10:22] If I expand it, I should have some moving numbers. Now what's kind of new too, is that whole parameter part there, if I go to the parameters little item here, which is new, this wasn't here when we were just creating the tags over manually. If I expand this, we can see that we do have our station number parameter which does in fact have a value of one that also means I could go over here and write to it. Now if you try to write to it. For example, if I were to double-click where it says one if I were to type in a two and hit Enter you're going to get a little pop-up like this because by default, the Designer starts off in a read only states just to prevent you in like a production system for preventing you from accidentally writing the things you don't necessarily mean to. But we're doing our little test environment here. So it's not a big deal. I'm going to enable read-write mode which is actually that little button was up above. I can actually toggle the Designers read and write mode with these buttons here but let's go back down here. Now that I'm in read only mode or read-write mode you can see that I can change this to a value of three.

[11:23] It kind of reloads. And then it goes into, looks up different tag values. What I don't honestly want Right-click to show a station number three, I want it show a station number of one but that also means I could actually select Station one. I could Right-click. I could Copy that. And then I can Right-click on the background and into an empty spot here I could Paste and then go ahead and create a station two. It not that smart. It just named a station two, because oh, hey there's already Station one, it can't have identical items at the same route. It went ahead and just incremented the number at the end. If there wasn't any number at the end it would add one for you. Otherwise these have the same values for the same tags here. For station two, we should change the parameter to two. And also means I can Right-click and Paste again. It should give us a station three. We'll change the parameter to station three.

[12:23] We're actually all good now that we have some values. That was a little bit of extra work again do we have more UDT videos that kind of talk about why to do that but when you have kind of of large systems and you have lots of tags and you have a lot of repeated structures the UDTs is a little bit nicer. And for us, for this project here, it's actually going to save us time in the future a little bit. When we start adding a history on a bunch of these tags here, and we start adding alarms, it'll be nice because instead of going to all the tags and editing each one of these individually or in groups, we can actually just go to the UDT definition, apply our configurations. And then those changes will be then pushed back to our instances. So let's save a little bit of time in the future but that about does it for the data portion here. We can go ahead and now actually start talking about how to build our screens which we'll do in the next video.

You are editing this transcript.

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

close

Share this video