Frequently asked questions
The Application of PLC Automatic Control Principle in Configuration Software Control System
Although PLC and IPC play different roles in automation control, people still hope to use IPC for core control in many places where the continuous operation time is short and the environment is relatively good. There are many ways to implement core control using IPC, of course, the simplest way is to use configuration software.
Configuration software is used for control in many situations, but the center of the entire control is often still PLC, and the control role played by configuration software (upper computer) is very small. The human-machine interface is generally used for simple action control, process parameter preparation, formula setting, etc. Although it belongs to the control category conceptually, it does not truly play a core control role because the true long-term automatic operation control is completed by PLC. There are two reasons why we don't often use industrial computers as the core control part: firstly, industrial computers are not suitable for running in very harsh environments; Secondly, the Windows system often used by industrial computers is not reassuring, as its long-term performance is not good.
Since its inception, PLC has played an irreplaceable core control role in various industries of automatic control. PLC operates stably and is suitable for various harsh industrial environments. Compared to industrial control computers (IPC), PLC has stable operation, good scalability, convenient electrical connection, and more professional control. However, the excellent human-machine interface and convenient high-level language of IPC are incomparable to PLC.
This article discusses the problems that users often encounter when using configuration software for control. When many users use configuration software for control, especially when using serial port connection, it is found that the automatic control of configuration software can affect the data collection speed. This article focuses on how to solve this problem, and the solution is to apply the control method of PLC to the serial port control of the upper computer.
PLC operating principle
Without interruption, the PLC adopts a "sequential scanning, continuous cycling" working mode.
1) Each scanning process. Concentrate on sampling the input signal and refreshing the output signal.
2) Enter the refresh process. When the input port is closed, the program enters a new state during the execution phase, and the new state cannot be read in. The new state is only read in when the program performs the next scan.
3) A scanning cycle is divided into input sampling, program execution, and output refresh.
4) The content of the component image register changes with the execution of the program.
5) The length of the scanning cycle is determined by three factors:<1>the speed at which the CPU executes instructions< 2> The time occupied by the instruction itself< 3> Number of instructions.
6) Due to the use of centralized sampling. The centralized output method has the phenomenon of input/output lag, i.e. input/output response delay.
The reason for the slow data collection caused by users using configuration software control is the problem that many configuration software users encounter when writing upper computer automatic control programs. What is the reason behind this? Can there be a good solution?
Let's first briefly describe the principle of data acquisition and control in configuration software. Under normal circumstances, the configuration software sends read commands to the lower computer at regular intervals to wait for a response from the lower computer to intercept the data that needs to be queried. Through repeated cycles, the data is dynamically displayed on the upper computer, achieving real-time data collection. So when we need to control the lower computer, the configuration software will write corresponding commands to achieve "real-time control" of the upper computer over the lower computer.
On the surface, it may seem reasonable, but why is there a situation of slow data collection? Originally, everything was attributed to the read and write mechanism of the configuration software. In order to achieve fast control, the configuration software gives high priority to the execution of write commands. That is to say, when there is a write (control) command, the configuration software first executes the write command, and it does not resume normal read (acquisition) cycles until there is no write (control) command.
Therefore, it is not difficult to find the reason why users often experience slow data collection. If users frequently issue control commands, the system will allocate very little time for data collection, resulting in slower or interrupted data collection. Repeated assignment of a variable by a user in a loop instruction (such as y0=1) can lead to the above problem. Therefore, our solution is to control when needed and let go when no control is needed. To achieve this control method, we can refer to the operating mode of the PLC.
