All PLCs have four basic stages of operations that are repeated many times per second. Initially when turned on the first time it will check its own hardware and software for faults. If there are no problems it will copy all the input and copy their values into memory, this is called the input scan. Using only the memory copy of the inputs the ladder logic program will be solved once, this is called the logic scan.
While solving the ladder logic the output values are only changed in temporary memory. When the ladder scan is done the outputs will updated using the temporary values in memory, this is called the output scan. The PLC now restarts the process by starting a self check for faults. This process typically repeats 10 to 100 times per second as is shown in Figure PLC Scan.
1. Self test – Checks to see if all cards error free, reset watch-dog timer, etc. (A watchdog timer will cause an error, and shut down the PLC if not reset within a short period of time – this would indicate that the ladder logic is not being scanned normally).
2. Input scan – Reads input values from the chips in the input cards, and copies their values to memory. This makes the PLC operation faster, and avoids cases where an input changes from the start to the end of the program (e.g., an emergency stop). There are special PLC functions that read the inputs directly, and avoid the input tables.
3. Logic solve/scan – Based on the input table in memory, the program is executed 1 step at a time, and outputs are updated. This is the focus of the later sections.
4. Output scan – The output table is copied from memory to the output chips. These chips then drive the output devices.
The input and output scans often confuse the beginner, but they are important. The input scan takes a snapshot of the inputs, and solves the logic. This prevents potential problems that might occur if an input that is used in multiple places in the ladder logic program changed while half ways through a ladder scan and thus changing the behaviors of half of the ladder logic program. This problem could have severe effects on complex programs. One side effect of the input scan is that if a change in input is too short in duration, it might fall between input scans and be missed.
When the PLC is initially turned on the normal outputs will be turned off.
This does not affect the values of the inputs.