1. Concept and composition of PLC input/output lag time

PLC input/output lag time, also known as system response time, plays an important role in industrial control. It reflects the time interval from the change of the external input signal to the change of the external output signal it controls.
First, the input circuit filtering time is part of it. Digital input modules usually use RC filtering circuits to filter out the interference noise introduced by the input end and eliminate the adverse effects of jitter when the external input contacts are activated. The time constant of the filtering circuit determines the length of the input filtering time. Generally, this time is about 10ms. In addition, the input delay time of some input modules can be set through STEP 7.
Secondly, the output circuit lag time is closely related to the module type. The lag time of the relay output circuit is generally around 10 ms; the lag time of the bidirectional thyristor output circuit when the load is powered on is about 1ms, and the maximum lag time from power-on to power-off of the load is 10ms; the lag time of the transistor output circuit is generally less than 1 ms.
Finally, the lag time caused by the scanning working mode cannot be ignored. In the worst case, the delay time caused by the scanning mode can be up to two to three scanning cycles. The total response delay time of the PLC is generally only a few milliseconds to tens of milliseconds. For general systems, this response delay time is usually insignificant. However, for special systems that require the lag time between input and output signals to be as short as possible, you can choose a PLC with a fast scanning speed or take measures such as interrupts. In short, understanding the components of PLC input/output lag time will help us better select and use PLCs in practical applications to meet the needs of different systems.

2. Factors affecting PLC input/output lag time

(I) PLC performance factors

  1. Processing capacity: The performance and operation speed of the PLC processor affect the response speed. The faster the processor, the faster the processing and output response speed. Generally speaking, high-performance processors can process input signals and generate output signals in a shorter time. For example, some advanced PLC processors can execute millions of instructions per second, greatly improving the response speed of the system. If the processor performance is insufficient, there will be response delays when facing complex control tasks.
  1. Program execution time: Complex program logic, a large number of instructions, or the use of complex algorithms will increase program execution time and affect response speed. When the PLC program is very complex and contains a large number of logic, conditional statements, and loops, the PLC needs to spend more time to execute and calculate the complex program logic. According to statistics, a program containing complex algorithms and a large number of conditional judgments may take several times or even dozens of times longer to execute than a simple program. This will increase the input/output lag time and affect the real-time performance of the system.

(II) Input and output module factors

  1. Input module delay: It takes a certain amount of time to convert external signals into internal signals. When the input module converts external signals into internal signals, it needs to go through a series of circuit processing and signal conversion processes. There will be a certain amount of delay in this process. For example, the delay time of some input modules may be between a few milliseconds and tens of milliseconds, depending on the type and performance of the module.
  1. Output module delay: It takes a certain amount of time to convert internal signals into external actions, and different module types have different lag times. The lag time of the relay output circuit is generally around 10 ms; the lag time of the bidirectional thyristor output circuit when the load is powered on is about 1ms, and the maximum lag time from power-on to power-off of the load is 10ms; the lag time of the transistor output circuit is generally less than 1 ms. Different output module types are suitable for different application scenarios. When selecting an output module, it is necessary to make a reasonable choice based on the system's response requirements and load characteristics.

(III) Communication Factors

Communication delay will affect the response speed. Communication protocol, rate and link stability affect communication delay. If the PLC needs to communicate with other devices, communication delay will become an important factor affecting the response speed. Different communication protocols have different efficiencies. For example, some high-speed communication protocols can transmit a large amount of data in a short time, while some low-speed communication protocols may cause increased communication delay. In addition, the communication rate and the stability of the communication link will also affect the communication delay. If the communication link is unstable, it may cause data loss and retransmission, thereby increasing communication delay.

(IV) Control System Factors

The sampling period determines the sampling frequency of the input signal. A shorter sampling period can increase the response speed of the PLC to the input signal, but it will also increase the calculation load of the PLC. Therefore, when selecting the sampling period, it is necessary to comprehensively consider the response requirements of the system and the computing power of the PLC. If the sampling period is too short, the PLC may not be able to process a large amount of input data in time, thus affecting the stability of the system.

(V) Network load and environmental factors

Heavy network load or interference sources may affect the response speed. If the network where the PLC device is located has a high load, that is, there is a large amount of data transmission or communication on the network, the PLC response speed may slow down. In addition, interference sources such as electromagnetic interference and noise may also affect the signal transmission of the PLC, thereby affecting the response speed. In practical applications, it is necessary to reasonably plan the network structure, reduce the network load, and take appropriate anti-interference measures to improve the response speed of the PLC.

3. Measurement Method of PLC Input and Output Lag Time

The input/output lag time of a PLC is composed of multiple parts, including input circuit filtering time, output circuit lag time, and lag time caused by the scanning working mode. Measuring this lag time is crucial to evaluating the performance of the PLC in a specific application.
First, the input circuit filtering time can be measured by looking at the technical specifications of the PLC or using specific test equipment. Generally speaking, the time constant of the RC filter circuit of the digital input module determines the length of the input filtering time. For example, the input filtering time of some PLCs may be between a few milliseconds and tens of milliseconds, depending on the design and parameter settings of the filter circuit. You can use an oscilloscope and other equipment to observe the changes in input signals and the response time of the PLC's internal input registers to determine the input circuit filtering time.
For the measurement of the output circuit lag time, you can connect a specific load and a measuring device. Different types of output modules have different lag times. The lag time of the relay output circuit is generally around 10 ms, which can be determined by measuring the time from the output signal being generated from the PLC output end to the actual action on the load. The lag time of the bidirectional thyristor output circuit when the load is powered on is about 1ms, and the maximum lag time from power on to power off is 10 ms. You can use a special time measuring instrument to record these times. The lag time of the transistor output circuit is generally less than 1 ms, which can also be measured by precise time measuring equipment.
The lag time caused by the scanning working mode is relatively complicated. Generally speaking, the longest response time can be calculated by the formula, such as the longest response time is input response time (t1) + 2 scan cycles (2T) + output response time (t6). Among them, the input response time is the time from the generation of the input signal to the completion of the storage in the input register, which can be set and the default is 8ms; the scan cycle depends on the hardware configuration of the system and the instructions and number of instructions used in the control software, and the typical value is 1~100ms; the output response time depends on the output circuit and load used, which is generally several milliseconds.
In actual measurement, the input/output lag time of the PLC can be determined by simulating different input signal changes and observing the response time of the output signal. For example, a pulse signal generator can be used to generate an input signal of a specific frequency and amplitude, and then an oscilloscope or time measurement device can be used to record the response time of the output signal. By taking the average value of multiple measurements, more accurate lag time data can be obtained.
In short, understanding the measurement method of PLC input and output lag time can help engineers better evaluate and optimize the performance of PLC control systems and ensure the reliability and real-time performance of the system in different application scenarios.

Fourth, the impact of PLC response time on industrial production

PLC response time has a significant impact on industrial production in many aspects.
First, in terms of control accuracy, a shorter response time can ensure that the PLC responds more promptly to changes in input signals, thereby achieving more precise control. For example, in the process of high-precision mechanical processing, the control requirements for parameters such as position and speed are extremely high. If the response time of the PLC is long, it may cause a large deviation between the actual processing position and the expected position, affecting the quality of the product. According to actual production data statistics, in some precision processing fields, for every 1 millisecond reduction in the PLC response time, the processing accuracy of the product may increase by several microns.
Secondly, in terms of the ability to cope with complex tasks, the fast response time enables PLC to better handle complex control logic and multi-task parallel execution. In modern industrial production lines, it is often necessary to control multiple equipment and process links at the same time, and the coordination and cooperation between these links is very high. If the response time of the PLC is too long, it may cause uncoordinated actions between the various links, affecting production efficiency and even causing equipment failure. Taking the automobile manufacturing production line as an example, the time interval between each process is very short, and the PLC needs to be able to respond to various sensor signals within milliseconds to ensure efficient and stable automobile production.
In addition, the response time of the PLC will also affect the stability of industrial production. When the response time is long, it may cause the system to be unable to respond to abnormal situations in time, thereby causing production accidents. For example, in the chemical production process, if there are abnormal changes in parameters such as temperature and pressure, the PLC needs to make adjustments quickly, otherwise it may cause serious consequences such as explosions. A shorter response time allows the PLC to monitor and control various parameters in the production process in a timely manner, improving the safety and stability of production.
To sum up, the response time of the PLC has a vital impact on the control accuracy of industrial production, the ability to cope with complex tasks, and the stability of production. In the field of industrial automation, we must pay full attention to the response time of the PLC, and shorten the response time as much as possible by reasonably selecting hardware equipment and optimizing program structure, so as to improve the efficiency and quality of industrial production.

4. Methods to reduce PLC input and output lag time

(I) Improve PLC processing capabilities

  1. Choose a high-performance PLC: Choosing a PLC with a faster processor and larger memory can significantly improve its processing speed for input signals and output response speed. For example, some advanced PLC processors can execute millions of instructions per second, and can handle complex control tasks in a shorter time. The increase in memory can also allow the PLC to process more data at the same time, reducing the time for data exchange.
  1. Optimize program code: By optimizing the PLC program code and reducing unnecessary instructions and logical judgments, the program execution time can be reduced, thereby shortening the response time. When programming, complex algorithms and large amounts of data processing operations should be avoided, and concise and efficient codes should be used as much as possible. According to statistics, the optimized program code can shorten the PLC response time by 20% to 30%.

(II) Reduce input and output module delay

  1. Choose low-latency modules: Select input and output modules with low latency characteristics to reduce the transmission time of signals between modules. Different types of modules have different delay times and should be selected according to actual application requirements. For example, the lag time of transistor output circuits is generally less than 1 ms, which is suitable for occasions with high response speed requirements.
  1. Optimize input and output configuration: Reasonably configure the parameters of input and output points, such as filtering time, response time, etc., to reduce the delay of signal processing. By adjusting the filtering time of the input module, the interference to the input signal can be reduced and the response speed can be improved. For the output module, the output response time can be adjusted according to the load characteristics to meet different control requirements.

(III) Optimize program execution time

  1. Use modular programming: decompose complex control logic into multiple independent modules, each module is responsible for a specific function. In this way, the modules can be called separately when needed, reducing unnecessary program scanning time. For example, in a large automated production line, different process links can be written into independent modules. When a link needs to be controlled, the corresponding module is directly called to improve the execution efficiency of the program.
  1. Use fast execution instructions: In PLC programming, try to use instructions with fast execution speed and avoid using complex algorithms or large amounts of data processing operations. Some fast execution instructions can complete operations within a few microseconds, greatly improving the execution speed of the program.

(IV) Reduce communication delay

  1. Choose an appropriate communication protocol: Choose a low-latency, high-efficiency communication protocol such as Ethernet, Profibus, etc. according to application requirements. Different communication protocols have different performance characteristics and should be selected according to actual conditions. For example, the Ethernet communication protocol has the characteristics of high-speed transmission and low latency, and is suitable for occasions with high response speed requirements.
  1. Optimize network architecture: Design a reasonable network architecture, reduce the number of communication paths and network devices, and reduce the delay of signal transmission. By reducing the number of relay devices and routers in the network topology, the signal transmission time can be reduced. At the same time, the stability of the network connection should be ensured to avoid signal interference and loss.
  1. Increase bandwidth: Increasing network bandwidth can reduce the time delay of data transmission. Using higher-speed network devices, using link aggregation technology (such as Ethernet bonding), or increasing the number of network cables can increase bandwidth. For example, using a high-speed Ethernet module can achieve faster data transmission speed and reduce communication delay.

5. Other measures

  1. Reduce sampling period: In a control system, a shorter sampling period can improve the response speed of the PLC to the input signal, but the calculation load and stability of the PLC also need to be considered. The appropriate sampling period should be selected according to the actual situation, and the sampling period should be shortened as much as possible while ensuring the stability of the system.
  1. Hardware and software optimization: Rationally design and optimize the hardware and software structure of the PLC, including using high-performance processors, optimizing program codes, reducing communication delays, etc. The performance and response speed of the system can be improved by regularly upgrading the hardware and software of the PLC.
  1. Avoid electromagnetic interference and noise: Ensure that the environment where the PLC is located is free of external factors such as electromagnetic interference and noise to avoid affecting its normal operation and response time. Shielded cables, filters and other equipment can be used to reduce the impact of external interference on communication. At the same time, interference between communication lines and power lines, motor lines, etc. should be avoided.