Throughout this 4+ year-old thread, there has been a fair amount of inaccuracies and misconceptions about AOIs and UDTs.
Let me try to clear up any confusion people may have....
Neither AOIs (Add-On Instructions). nor UDTs (User-Defined Data-Types) exist in any PLC or controller you buy from Allen-Bradley. Both have to be created by the programmer. There is absolutely NO tie-up with AOIs and UDTs, they are as different as chalk and cheese.
An AOI is a mechanism that allows the programmer to enhance or extend the capabilities of the built-in instruction set, and it does this by way of building what appears to be a PROGRAM, and places that in the "Add-On Instructions" section of the organiser. You can make a "call" to the code of the AOI from anywhere in the main code of the application, or from any other AOI. The programming software puts the AOI on the screen just like any other of the built-in instructions.
That AOI "program" will, by default, have a routine that is executed whenever the AOI is TRUE, but you can create another routine that is executed instead when the rung that the AOI is in evaluates as FALSE. This can be used for housekeeping the data that the AOI uses, resetting flags, timers, counters etc. This "Enable-In False" routine is not mandatory, but you may NEED one to ensure correct operation of the AOI logic.
Another routine you can create within the AOI is the Pre-Scan routine. If enabled, this routine may be used to intialise the data within the AOI to a known state. Without the pre-scan routine, the data tags associated with the routine will be determined by its last execution,m which may not be acceptable for a controller restart.
A UDT is a mechanism that allows the user to create his own Data-Types, enhancing and extending the range of pre-defined data-types available by default. You can build your own UDTs that are more "amenable" to the application.
An example (from my background) could be a "Recipe" for beer-brewing. Different beers will have different quantities of ingredients and additives, and can be processed with different "parameters". All of the data in a Brew Recipe, which could be 100's of values, of a mixture of data-types, has to be moved with the brew it belongs to from one stage of the brewing to the next (beer-making is a batch process, involving several stages in the "brew-stream").
Moving that data used to be a long-winded process, because of the different data-types. By creating a UDT of the recipe, you can then create "containerised" structured tags that can now be easily "moved" from one process to the next, using COP or CPS instructions, or even produced and consumed by another PLC (messaging might be required if the Brew tags are over 500 bytes, which is highly likely).
Another great "feature" of UDTs is that the "members" of them are named, so using them as templates for recipe tags makes the code easily readable, e.g. the parameter specifying the feed rate of Malt into the Malt Mill might be "Carling.Milling.InfeedRate".
In summary, AOIs and UDTs are not tied together in ANY way. You can use AOIs with or without UDT tags, the choice is yours. You can use UDTs with or without AOIs, again the choice is yours.
Hope this helps someone ....