Share this

Basic working principle of PLC

2026-04-06 05:09:29 · · #1

The PLC scanning process mainly consists of three stages: the input sampling stage, the user program execution stage, and the output refresh stage, as shown in the figure.

1. Input sampling stage

During the input sampling phase, the PLC sequentially reads all input states and data in a scanning manner and stores them in the corresponding units of the I/O image area. After input sampling is completed, the process transitions to the user program execution and output refresh phases. During these two phases, even if the input states and data change, the states and data in the corresponding units of the I/O image area will not change. Therefore, if the input is a pulse signal, the width of the pulse signal must be greater than one scan cycle to ensure that the input can be read under any circumstances.

2. User program execution phase

During the user program execution phase, the PLC always scans the user program (ladder diagram) sequentially from top to bottom. When scanning each ladder diagram, it first scans the control circuit formed by the contacts on the left side of the ladder diagram, performing logical operations on the control circuit in a left-to-right, top-to-bottom order. Then, based on the result of the logical operation, it refreshes the state of the corresponding bit in the system RAM storage area for that logic coil, or refreshes the state of the corresponding bit in the I/O image area for that output coil, or determines whether to execute the special function instruction specified by that ladder diagram. That is, during user program execution, only the state and data of input points in the I/O image area remain unchanged, while the state and data of other output points and soft devices in the I/O image area or system RAM storage area may change. Furthermore, the program execution result of the ladder diagram above will affect any ladder diagram below that uses those coils or data; conversely, the refreshed state or data of the logic coils in a lower ladder diagram will only affect the ladder diagram above it in the next scan cycle.

3. Output refresh phase

After the user program scan is complete, the PLC enters the output refresh phase. During this period, the CPU refreshes all output latch circuits according to the corresponding states and data in the I/O image area, and then drives the corresponding peripherals through the output circuits. This is when the PLC actually outputs data.

Input/output lag

From the working process of the PLC, we can summarize the following conclusions.

When a program is executed in a scanning manner, there is an inherent lag in the logical relationships between its input/output signals. The longer the scan cycle, the more severe the lag.

The scan cycle includes the time taken up by the three main working stages: input sampling, user program execution, and output refresh, as well as the time taken up by system management operations. The program execution time depends on the program length and the complexity of the instructions, while other aspects remain relatively constant. The scan cycle is typically in the nanosecond range.

• When executing the program for the nth scan, the input data is the scan value X from the sampling phase of this scan cycle. The output data includes the output value Y(n-1) from the previous scan and the output value Yn from the current scan. The signal sent to the output terminal is the final result Yn after all the operations are performed.

Input/output response lag is not only related to the scanning method, but also to the program design.

Disclaimer: This article is a reprint. If it involves copyright issues, please contact us promptly for deletion (QQ: 2737591964 ) . We apologize for any inconvenience.

Read next

CATDOLL 126CM Yoyo (Customer Photos)

Height: 126cm Weight: 23kg Shoulder Width: 32cm Bust/Waist/Hip: 61/58/66cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22