Micrologix controller, I need to add a timer in a subroutine, can any help me understand how the timer in the subroutine reacts? Will I stay in the subroutine while the timers times or do I scan once thru the subroutine? Any help would be greatly appreciated.
You do not have a grasp of how PLCs in general work.
The user code is "scanned" continuously, no instruction will ever stop the code being scanned.
Each time a rung of logic is scanned, it is evaluated, the output instruction(s) are executed, and the scan continues.
As already stated, a TIMER isn't actually a timer, it is simply an instruction that compares the current PLC clock to the previous time it was scanned, calculates how much "time-periods" to add to the accumulator value, updates the accumulator accordingly, stores the current PLC clock data (internally), then tests to see if the accumulator value is greater-than, or equal-to, the preset value. If it is, it sets the .DN bit.
Because of the way TIMER instructions work, it will always be possible (especially with a fast TimeBase) to see a .DN timer with the .ACC greater than the .PRE, because it wasn't scanned at the time the timer preset would have occurred. The explanation above also tells you that TIMER instructions can never be "accurate".