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 docs@inductiveautomation.com.
Version:
LESSON LIST
Description
Learn how to use the Multi-Instance Wizard to rapidly create many UDT instances at once.
Video recorded using: Ignition 8.3
Transcript
(open in window)[00:00] In this lesson, we'll learn how to use the Multi-Instance Wizard tool. This allows us to create many instances of a UDT very easily. Let's take a look at this UDT I have named area. I want this UDT to help represent a mock facility. At the facility there's some buildings and within those we have designated areas. Each area has a tank holding some liquid. My area UDT has this tank UDT nested within it. Each tank has a value being recorded for its current level. In the OPC item path, there's this tank num parameter, and if we look at the parameter, we see that tank num is an integer. This item path I'm using is from the ignition programmable device simulator. Let's use the multi-instance wizard to create four different areas in building one. Those are areas , A, B, C and D. Let's also use the wizard to configure the parameter so that each area has a unique tank level.
[01:08] We'll move over to the tags tab so we can access the wizard. Before opening the wizard, we do need to specify the target location. In the tag browser, I have this area's folder, so we'll select it and then right click and choose the multi-instance wizard. The wizard starts us off in the create instances tab, and right away our data type is populating as area. If you had other data types, you could see them in this dropdown menu. Our folder location is using the selected areas folder, but you are able to change the location by clicking on the browse folder icon. We are going to name each instance by area, so we can type that out into the base instance name, and we can already see down in the preview that our instance name was applied. As we make changes in this menu, they'll be reflected down in the preview letting us know what the incidents will look like.
[02:02] To add in the A, B, C, and D to the name, we'll create a reference. Looking at this tool tip here, we can create one by enclosing a value in curly braces. Those characters should be placed after the area text, so we'll add a space and place an X in between some curly braces. We now get access to this reference configuration table. There's a few pattern types for references and we'll choose alpha upper. These number format and step count fields are specific to numeric types, so they'll be grayed out here. We're going to start from the character A, so we can leave that field alone. The end a character should be changed to D. Make sure to hit the enter key after typing in the value. Now there's four instances in our preview since our reference generated A, B, C, and D. You certainly can have more than one reference and we should add another one to account for the building number. So we'll add in front of our instance name the word building. Then we'll add a space and another reference.
[03:03] I'll type out the character Y in curly braces and add a space after this reference. The preview shows each area in building one, so there's nothing for us to change in the reference table. Using a numeric pattern if we're starting from and ending at one, then our reference can only be the number one. We could add some leading zeros to our reference with this number format field. We'll add another one here, but just know you can add as many as you'd like. Our instance name looks pretty good, so let's move on to the configure parameters tab. We can see our parameters listed out here and our preview section still remains. Right now we don't have any pattern defined, but we can update that by clicking on this checkbox next to tank number. We'll click on the pattern type dropdown where we see the word done and we'll choose the numeric option. And again, there's really not much for us to change at this point since each tank number is unique and that's all I required at my facility. Let's change the start from and step count fields just to see how those work.
[04:04] Maybe we could give start from a value of two and also have step count be a value of two. This would give us all even tank numbers starting from two. And if you can't find a pattern that works for you, you can also change the type to manual entry. Maybe we want the tank numbers 2, 4, 6, and 9. You would just need to click on the pencil icon in our parameter field and we can manually enter those in. Make sure to hit enter on your keyboard and click on, okay. At this point, I'm satisfied with the structure of my instances. Let's click on create and look at the result of this configuration. We'll expand the areas folder, and we'll see all four areas were created. They're within building one, and if we drill into any one of them, maybe area A, for example, we'll find a tank and if we drill into that, we'll see a unique tank level. And just to verify that the tank num parameter is unique per instance, we'll drill into area B to find the level, and we should see a different value here.