Working principle
PLC adopts a cyclic scanning working mode. It will execute three stages in sequence: input sampling, program execution and output refresh. In the input sampling stage, the PLC reads the status of all input terminals into the input image register. In the program execution stage, the CPU performs logical operations and other operations according to the user program, and the output refresh stage outputs the content in the output image register to the actual output terminal.
For example, when the external input signal changes during the program execution stage, the PLC will not respond to this change immediately. Because it has to wait until the input sampling stage of the next scan cycle to read the new input state, and then process it through the program, and then output the result in the output refresh stage, which leads to a certain lag.
The influence of program length and instruction complexity
The length of the scan cycle is related to the length of the user program and the complexity of the instructions. If the program is long and contains a large number of instructions, the time required for the PLC to execute a scan cycle will be longer.
For example, a program with thousands of lines of complex logic instructions may have a scan cycle of tens of milliseconds or even longer. In this process, the input signal may have changed, but because the PLC is still executing the previous program part, it cannot process the new input signal in time, thereby increasing the lag time of the output response.
Setting of input filter time
PLC usually sets input filter time to prevent interference in the input signal. This filter time will delay the effective reading of the input signal.
For example, when a short pulse signal is input, if the filter time is set to 10ms, then the pulse signal must last for more than 10ms before it can be recognized as a valid input signal by the PLC, which will also cause the output response to lag.
Characteristics of output module
The output module itself has a certain response time. For example, it takes a certain amount of time for the output relay of a relay output PLC from the coil to the contact action. The action time of a general relay ranges from a few milliseconds to tens of milliseconds.
For transistor output PLC, although the action speed of the transistor is much faster than that of the relay, it also has a transition time from the arrival of the drive signal to its complete conduction or cutoff, which will also affect the timeliness of the output response.

