In Logix you don't copy-paste a routine to reuse it β you package it as an Add-On Instruction. Define the logic once, give it parameters, and it drops onto the rung like a built-in instruction. Each instance carries its own tag, so a motor AOI works identically on motor 1 or motor 50, never sharing state.
The AOI aoi_Motor is defined once at the top β its interface (Inputs, Outputs) and hidden Local tags. Below, it's instanced on three conveyor motors. Each instance is a separate backing tag (Mtr_1, Mtr_2, Mtr_3): run one and only its state changes. Same code, isolated data β exactly like an FB elsewhere, but Rockwell-flavoured.
Press "Fix a bug" β one edit to the definition instantly applies to all three instances, because they share the same code. Yet Mtr_1.Runtime never bleeds into Mtr_2. AOIs are also version-stamped and can be source-protected, so a vendor ships logic you use but can't see.
π₯ Input parameters β values passed in each scan (Start, Stop, a setpoint). Copied in when the instruction executes.
π€ Output parameters β results the AOI produces (Running, Fault, Runtime). Visible to the calling routine.
π Local tags β the AOI's private workspace (seal-in bits, timers). Hidden from the outside β true encapsulation per instance.
π InOut β a reference to a tag passed by alias (e.g. a whole UDT), so the AOI works on the caller's data directly.
You fix a bug in aoi_Motor, used as 40 instances. How many places must you edit?