Explanation
Step 1 - Update the input image table. In this step, the processor checks each input address in the following manner: If there IS a signal present at the input module screw, put a “1” in the bit associated (by its address) with that screw. If there is NOT a signal present at the input module screw, put a “0” in the bit associated (by its address) with that screw. Specific definition: input bits are bits whose addresses begin with the letter “I”.
Step 2 - Execute the ladder logic. In this step, the processor executes the rungs one at a time, in order, going from top to bottom. If the instructions on a rung command the processor to turn ON a particular bit, then the processor will place a “1” in that bit. If the instructions on a rung command the processor to turn OFF a particular bit, then the processor will place a “0” in that bit. It does NOT matter whether the particular bit being controlled is an output bit - or an internal bit - or even (believe it or not) an input bit. The processor will write the commanded “1” or “0” instantly - before moving on to the next instruction. The processor scans ALL of the ladder rungs before it goes on to the next step.
Step 3- The Processor runs a few routine diagnostic steps, and checks various communications associated.
Step 4 - Send the output image table to the output modules. In this step, the processor takes the “1” or “0” contents of the output bits and sends this information to the output modules. At this point, any real-world outputs which are marked with “1” are turned ON.
Any real-world outputs which are marked with “0” are turned OFF. Specific definition: output bits are bits whose addresses begin with the letter “O”.
Now the processor goes back to Step 1 - and starts the scan over again.
Elaborating on Step 2 - Suppose that the conditions on a rung at the top of the ladder command the processor to turn ON a particular output bit. But then the conditions on a rung at the bottom of the ladder command the processor to turn OFF the SAME output bit. (Normally this would be an error in programming). Question: will the real-world output (example: a lamp) be ON - or will it be OFF - or will the lamp FLICKER on and off very rapidly? Answer: the real-world output will be OFF. This is because the last rung which executed caused the processor to write a “0” into the output bit. And remember, the processor does not actually send the contents of the output table to the output modules until Step 3 - at the end of the scan. Yes, the processor DID change the contents of the output bit to a “1” when the first rung executed - but the output module had no way of knowing about that intermediate ON condition. Simply put: the processor controlled the bit - but the processor didn’t tell the output module about the bit’s ON/OFF status until after all of the ladder rungs were scanned.