It's very simple...
each rung has a destination results with no expected delay of information. All information required per rung is available. The logic with in each rung does not allow for any such process of loops that would other wise hold a program in place.
The whole idea of capturing external values and maybe some internal values to be fixed through the scan is the best solution, because there would never be any thing that can change with in the middle of a rung or multiple rungs or complete scan of all the page files.
The only items that change are those items that were captured at the start of a scan,which the OS of the PLC does that for you, you may change a value to one of these external events that were captured so that the remaining rungs that have not yet been scanned will see this change, But nothing is actually changed on the out side.
No loops there by waiting for an event that only takes place in some hardware timer or out side IO.
Talking about timers, All timers that have been started have their current values frozen at the start of the scan. No timers change while scanning down through the rungs. However, you can change a value of some timer that has been froze so that when you reach the end of all rungs, the timer will simply pick up and start from the change or from what ever it was before. These are ladder timers I refer to, not back ground real time timers, which you normally only have a couple of but with those you can make many software one's which is what the Ladder code uses for the most part. There are special timers/counters you can get to.
The only data that changes in real time while the rungs are being scanned are things like background communications, handling the hardware stuff. But any data you expect to read from this hardware is cached to be view only on the next scan cycle of the ladder program.
In other words, the Ladder never stops on a resource waiting for something specific to happen there by, holding up the rest of the system, that would be dangerous in many cases.
PLC controllers do not execute native code, that code you down load to the controller is like a form of P code.
There is very little a PCL does that could actually place a stall on your ladder code and that would be out of your hands. If things like that happens, there is something wrong and a watch dog timer kicks in and most likely will force a fault on the PLC and stop the ladder program. When this happens, all outputs on the PLC are switched off. SO you're suppose to tie in a interlock with one of the outputs.
You can have things like function blocks that contain FOR Loops to do a restricted amount of code. You can also have what looks like an INT service block and that still shares between the standard scan and INT's
When it comes to INT"s, what the system does is instead of doing a schedule ladder scan, it will call a INT block if a defined event like an external trigger took place on a input. The PCL will not wait for the schedule event. Doing that, the system still does the initial load of all the current inputs and outputs in cache before it goes to the ISR block.
Many PLC's also have a command that can force a early scan at the end of the ISR so to get things moving sooner.
BUt, You'll never see something like
While !(I:100.01) do; // where I:100.01 would be an INPUT for example.
That could really screw things up if the input does not come on in short time, that is, even if that command was doing real time hardware reads.
You simply do test and set a results on the test, you never loop to wait for the value to change to what you want.
All this can be done in a uC with C language with no problem. You just need to code with no wait loops.
Jamie