Yes, I understand the END rung.
I did not know the significance of file 2. I usually put it at the end of the file that has the most math functions and this time I put it in the last file. Today I linked up a counter to it to see how many times it was latching, just before the UTL.
I'll move it all to file 2.
Thank you,
OK, a quick lesson...
The processor will only execute file 2 automatically. (there are other files it will execute automatically, but more about these later).
User code that is placed in other files 3-255, is executed (usually) by the use of JSR (Jump to SubRoutine) instructions. After a Subroutine is finished, code execution always resumes at the calling routine.
Subroutines can "call" other subroutines, (we call it "nesting"), but each subroutine resumes from where it was "called"... This means that the "END" rung in file 2 will always be the last rung scanned in the "scan cycle".
Exceptions to the above...
STI (Selectable Timed Interrupt) : A ladder file that can be configured to be executed at a fixed time interval. The code is executed periodically, interrupting the main "scan cycle".
DII (Digital Input Interrupt) : A ladder file that can be configured to execute when a specified Input bit becomes true. The code is executed only once for each False to True transition of the specified input.
Fault Routine : A ladder file that can be configured to execute when a major fault is detected. The fault routine may, at the programmers discretion, clear the major fault, and allow the PLC to continue, otherwise the processor will halt, stop, red-light.
Hope this helps your understanding....