[00:00]
In this lesson, we'll talk about creating UDT instances. If you've been following along with prior videos under this topic, we're going to pick up right where we left off with our sensor type, which includes humidity and temperature tags as we see here. I would like to create an instance of this sensor UDT, which again is separate from a UDT definition. To create our instance, I need to find my way into the tags tab since instances live with the rest of our tags, not with the definitions, which are more like designs than actual tags. Once I'm here, I can add a UDT instance in effectively the same way I'd add another tag. Clicking the tag plus icon at the top of the tag browser will expand a dropdown for us. And from there we'll select data type instance, and then sensor. This will bring up the tag editor, which looks pretty similar to the UDT definition editor, except that we're now dealing with tags for an actual sensor.
[01:00]
I'll begin by giving the sensor a good name, something like sensor one, hitting the enter key when I'm done, which will change the name in the type structure. Now, believe it or not, we're nearly done with creating our instance. The last thing we need to do is specify values for any parameters our UDT is relying on. So I'll find the parameters field here and then click the pencil icon on the right-hand side. All of the OPC tags in our sensor type are relying on the SensorNum parameter here to decide which sensors items to look at. Since I'm setting up an instance for sensor one I'm just going to set the value here to one, then hit enter and click commit at the bottom. And that's it. Our UDT definition has already been set up to take care of the rest, so I can click okay at the bottom to finish creating the instance. And we'll see right away in the tag browser that our instance is working. To create additional instances we could run through the same interface again or copy and paste the instance changing the parameter for each paste. We'll also look at more advanced ways of creating many instances at once in a later video.