Skip to end of metadata
Go to start of metadata

 

It is possible to set up UDT inheritance where data types extend to other data types, to add additional members, or override default values.

To Inherit Property Values from an Existing UDT

Let's use our data type Motor, from the previous sections, to create another data type. We'll set the parent to Motor so our new data type automatically inherits all the properties of Motor.

  1. From Tag Browser, right-click on Data Type, and choose New Data Type.
    The Tag Editor window will open.
     
  2. In the Name box, enter a new name (i.e. VFD Motor), and from the dropdown of the Parent Type box, choose an existing UDT (i.e. Motor).
    This new UDT will automatically inherit all the properties of the parent UDT Motor:  AMPS, HOA, RUN_CMD, and STATUS. 



  3. You can add a new Tag to this new UDT by clicking the green + icon on the top-left of the Tag Editor window, and click New OPC



  4. Enter the following properties:

    Name:  SPEED
    Data Type:  Integer
    OPC Server:  Ignition OPC-UA Server (from the dropdown list)
    OPC Item Path:  Browse the PLC and find the VFD inside the ControlLogix program.  

    Click OK.  



    Because you are creating a UDT, you don't want to point to one specific set of Tags. You want each instance of the VFD Motor UDT to reference a different set of Tags. To do that, you need to add a parameter to the UDT.  

    In the OPC Item Path, replace the "CLX" with "{DeviceName}" using the down arrow, and the "1" with "{MotorNumber}" using the down arrow as shown below.



  5. Click OK again.  The new data type called VFD Motor inherited all the Tags from the Motor data type and is visible in the Tag Browser.
  6. Now, create an instance of the VFD Motor.  Go to the Tag Browser, and select Tags > New Tag > Data Type Instance > VFD Motor.



  7. The Tag Editor window will open. Enter the following:

    Name:  VFD1
    DeviceName Value:  CLX
    MotorNumber Value:  1

    Click OK



     
  8. Now, you'll be able to see all the values for VFD1, and that the SPEED Tag was added.  



Another nice benefit of the inheritance feature is it allows you to modify or override some of the parameters of the parent. For example, since the VFD Motor has Motor as the parent, you can go to any of the Tags and override any of the settings of that data type. 

  1.  Go to your Tag Browser, and double click on your VFD Motor.  The Tag Editor will open and you'll see all your Tags.  
     
  2. Select any of your Tags (i.e., AMPS). You can override any of the properties by clicking the circle to the right of the property. When you click the circle, it changes to green allowing you to override the property inherited from the parent. 



  3. You can also turn on Alarming or History that wasn't initially turned on in the parent by simply using the override feature. Click on Alarming, and under Alarm Configuration, select your alarm and click the Overwritten circle at the top right of the window changing it from gray to green.  




IULocgo


UDT Inheritance

 

 

 

  • No labels