Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Creating instances of UDTs is virtually identical to creating other types of Tags using the New Tag menu. Unlike standard Tags, it is likely that you'll have to modify attribute values or override certain member properties in order to make the instance unique.

Create a UDT Instance

Once a UDT definition is created, you can create an instance of the UDT as an actual Tag in Ignition. Now that you have the Motor UDT created from the previous section, let's create a UDT instance.

When creating UDT instances, it's a good idea to create a folder to keep your Tags organized. In this example, we will be creating a bunch of motors, so create a Motors folder in your Tag Browser to keep all your Motor Tags organized.



On_this_page



Scroll html ignore


Iulink
URLhttps://www.inductiveuniversity.com/videos/manually-creating-udt-instances/8.0
NameManually Creating UDT Instances





IulinkURLhttps://www.inductiveuniversity.com/videos/manually-creating-udt-instances/8.0NameManually Creating UDT Instances

To create a UDT instance, do the following:

  1. Right click on the Tags folder > New Tag > New Folder. Enter a name (i.e., Motors) for the folder and click OK
  2. In the Tag Browser, right-click on your Motors folder and select New Tag > Data Type Instance > Motor to create a new instance.

    Image Modified

  3. The Tag Editor window will open and you'll see a New Instance in the Type Structure area. Next to the Name property, assign the new instance a name, Motor 1.
  4. Enter the MotorNumber value for the Parameters property by clicking on the EditImage Modified icon. The Parameters window will open. 
  5. Enter a value for the MotorNumber that is used in the configuration of the UDT Motor. In this example, enter '1' and click Commit.  (Note: Id you want to cancel the entry and go back to the previous window, click Revert.)
  6. Click OK to create the Motor 1 instance.

    Image Modified

     
  7. From the Tag Browser, expand Motor 1 to verify that the Tags are working correctly.  

    Image Modified
     
  8. To verify that the OPC Item Path for the MotorNumber parameter was translated correctly, expand each of the Tags: Amps and HOA. You can see that MotorNumber (i.e., Motor 1) is displayed correctly. 

    Image Modified
     
  9. Repeat Steps 2 through 6 for each Motor you want to create. Each instance name must be unique. (Your next motor could be Motor 2.) Expand the Motors folder to see if Motor 2 was created and the Amps and HOA Tags are working. 

    Image Modified

On_this_page Scroll html ignore



Override Properties in UDT Instances

It is possible to override properties of a UDT instance to create a different base structure as compared to other instances of the same data type. This is an important feature in certain scenarios where you have to be able to override parts of the configuration of that instance. For example, you may have to create an instance of a UDT that uses a completely different OPC address scheme from the definition.

All the instances of the same data type definition have the same configuration, but when there is an instance which needs to have a different value from the rest of them, you can override that value. Let's use the Motor example from above and override the OPC Item Path property of the HOA Tag for the Motor 2 instance.


Scroll html ignore


Iulink
URLhttps://www.inductiveuniversity.com/videos/overriding-properties-in-udt-instances/8.0
NameOverriding Properties in UDT Instances




  1. From the Tag Browser, you would go to Tags > Data Types Motors > Motor 2. 
  2. Right-click on Motor 2 and select Edit tag to open the Tag Editor.
  3. Under Type Structure, select the HOA Tag. The circles to the riht of the property names are the override buttons. You'll notice that none of the properties have been overriden, otherwise they would be green.



  4.  Let's override the OPC Item Path for the HOA. Click the binding  icon and select Browse OPC.



  5. In this example, browse the OPC and select another HOA Tag, and click Commit.



  6. You'll notice the circle changed to green thus overriding the OPC Item Path for the HOA Tag. Click OK.



  7. Go to the Tag Browser, expand the HOA Tag for Motor 2, and see the updated OPC Item Path. 



  8.  To go back to the original configuration, unclick the green circle next to the OPC Item Path


Info
titleIf you Change the UDT definition on a Field that was Overwritten

It's important to note that if you make a change to the definition on a field that was overwritten, it will not update on that particular instance. That instance is locked in at that override, unless you go back to your instance and remove the override by clicking the green circle.