Skip to end of metadata
Go to start of metadata

 

It's possible to set up UDT composition in Ignition where you are putting one UDT inside of another UDT. 

In this example, let's use our a Motor and Tank data types that  were already created and used in previous sections of this manual. We are going to create a third UDT called Area that will contain the Motor and Tank data types inside of it. 

  1. In the Tag Browser, right click on  Data Types and select New Data Type.  The Tag Editor window will open.  
    Assign the new data type a Name called Area.

  2. Inside of the Area data type, create two data type instances, one for Motor and the other for Tank.  
    Click on the green + icon, select Data Type Instance > New Motor.
    Click on the green + icon, select Data Type Instance > New Tank.
    Rename both new data types to Motor and Tank respectively.  

     

  3. Now, you have both the Motor and Tank UDTs in the Area UDT.  Motor has two parameters: DeviceName and MotorNumber.  

     

    Tank also has two parameters: DeviceName and TankNumber.  



  4.  Every UDT you add inside another UDT, those instances have parameters that need to be specified and passed in from the parent UDT.  In the Area UDT, create the DeviceName, MotorNumber and TankNumber parameters in the the Area UDT.  (Even though both data types use the same DeviceName parameter, you only need to enter it once in the Area UDT).  

     

  5. The values in the Area UDT need to pass to the Motor and Tank data types so references need to be added.

    Click on Motor, and enter the following references. Note that you do not have to type, but can edit the Value field, and press the Down Arrow on the keyboard:
         For DeviceName, enter the value {DeviceName}.
         For MotorNumber, enter the value {MotorNumber}.

    Click on Tank, and enter the following references:
       For DeviceName, enter the value {DeviceName}.
       For TankNumber, enter the value {TankNumber}.
       
    Click OK

  6. Now, that you added all your parameters, create a new instance of Area.  In the Tag Browser, right click on Tags, select New Tag > New Data Type Instance > Area.

     


  7. The Tag Editor window will open. Enter a Name for the new instance name, called Area 1

    Enter the values for each parameter:
       For DeviceName, enter the value CLX.
       For MotorNumber, enter the value 1.
       For TankNumber, enter the value 100.
       Click OK

      


  8. From the Tag Browser, you can see Area 1 was created, and if you expand  Area 1, it will show the two UDTs (Motor and Tank) and that values are coming through pointing to the appropriate places in the PLC.

     


  9. Check the OPC Item Path in the Tag Tree to verify that Motor is pointing to Motor 1 and Tank is pointing to Tank 100.

     



 


IULocgo


UDT Composition

 


 

  • No labels