User Defined Data Type [UDT] Tutorial - Explanation, Usage, Examples & Custom Definition in RSLogix 5000

User Defined Data Types or UDTs are commonly used in Programmable Logic Controller Programming in order to group data and maximize code reusability. This structure allows the user to combine any of the existing data types into a package which can be reapplied multiple types across the program, be exported and imported into other structures.

This is a companion discussion topic for the original entry at

Can you create UDT while online or does the PLC has to be offline just as the case for creating AOI?

1 Like

You can add UDTs online. However, you can’t make changes to them as freely as you can offline. For that reason, I always recommend creating them offline and importing them into a program (can be done online). Once in place, if you need to make changes, you must delete all instances of that UDT and re-import.

Hope that helps,

1 Like

Is it possible to add an UDT inside another?

You can certainly nest UDTs. One caution I’d give against that is when you copy the parent UDT into a different program/PLC, it will break unless you copy all the ones used within as well. So you must be careful when you “import/export” the UDT that contains nested UDTs in it.

I’m looking to add to an existing data type. What would the best practice be? Should I edit data type offline and then push a download? Or create similar but new UDT and change names of all instances of existing one?


I’ve gotten both routes. It really boils down to two things:

  1. If the process must remain online, you can’t perform a download. You must go the “new UDT” route.
  2. If it’s extremely tedious to redirect all the instances to the new UDT or they are utilized in routines that may shut down the process. You must go the offline route.

I always prefer to go offline, edit, and download unless as mentioned above you can’t shut down the process.