As we all know, since its inception, plc has played an irreplaceable core control role in the automatic control of various industries. PLC is reliable in operation and suitable for all kinds of harsh industrial environments. Compared with industrial computer (IPC), PLC has reliable operation, good expandability, convenient electrical connection and more professional control, but the industrial computer has a good man-machine interface. High-level languages ​​are unmatched by PLCs.
The configuration software is applied to the control in many occasions, but the center of the whole control is often the PLC, and the control software (host computer) plays a small control role. The man-machine interface is generally used for simple motion control, process parameter preparation, recipe setting, etc. Although it is conceptually controlled, it does not really play a central role, because the real long-term automatic operation control is Completed by the PLC. There are two reasons why we do not use the IPC as the core control part frequently: First, the IPC is not suitable for running in a very hostile environment. Second, the Windows system often used by IPCs is not reassuring. Long-term operation is not good.
Although PLC and IPC play different roles in automation control, in many places where the running time is short and the environment is relatively good, people still want to use IPC for core control. There are many ways to implement core control using IPC. Of course, the easiest way is to use configuration software.
This article discusses the problems that users often encounter when using configuration software for control. In many users using the configuration software for control, especially when using the serial port connection mode for control, it is found that the configuration software automatically controls the data acquisition speed that will be affected. This article focuses on how to solve this problem, and the solution is to solve the problem. The control mode is applied to the host computer serial port control.
1 Reasons for slow data acquisition after the user controls with the configuration software
This is the problem encountered by many configuration software users in writing the automatic control program of the upper computer. What is the reason? Is there a good way to solve it?
We will briefly describe the principle of data acquisition control of the configuration software. Under normal circumstances, the configuration software periodically issues a read command to the lower computer to wait for the lower computer to respond to intercept the data to be queried. In the cycle of repeated cycles, the data is dynamically displayed on the upper computer to realize data “real-time acquisitionâ€. Then when we need to control the lower computer, the configuration software will write commands accordingly to realize the “real-time control†of the upper computer to the lower computer.
On the surface, it seems reasonable, but why is the data collection slow? It turns out that everything is "blamed" on the read and write mechanism of the configuration software. The configuration software implements the highest priority for the write command, so that when there is a write (control) command, the configuration software first executes the write command until the write (control) command is not configured. The software resumes the normal read (acquisition) loop.
Therefore, it is not difficult to find out why users often have slow data collection. If the user frequently sends out control commands, the system will allocate a small amount of time for data acquisition, resulting in slower or interrupted data collection. The user repeatedly assigns a variable to a variable in the loop instruction (such as y0=1), which will cause the above problem, so our solution is to control the control time, let go when no control is needed. In order to achieve this control method, we can refer to the operating mode of the PLC.
2 PLC operating principle
In the absence of interruption, the PLC uses the "sequential scanning, continuous cycling" mode of operation.
1) Each scanning process. The input signal is sampled intensively, and the output signal is refreshed intensively.
2) Enter the refresh process. When the input port is closed, when the program is in the execution phase, the input has a new state and the new state cannot be read. The new state is only read when the program performs the next scan.
3) One scan cycle is divided into input sampling, program execution, and output refresh.
4) The contents of the component map register change as the execution of the program changes.
5) The length of the scan cycle is determined by three: <1> the speed at which the CPU executes the command; <2> the time the instruction itself occupies; <3> the number of instructions.
6) Due to the use of centralized sampling. In the way of centralized output, there is a phenomenon of input/output lag, that is, input/output response delay.
3 Summary
As mentioned above, in the configuration software control, we use the method of first computing and then output, that is, when there are loop complex operations on IO variables, we use intermediate variables to calculate, and we will assign values ​​to IO variables when the results are calculated. This will solve the problem of slow acquisition in control.
Zysen provides a wide range of power dividers (coaxial splitters) 2 Way, 3 Way, 4 Way, 6 Way, 8 Way or 12 Way port designs. Narrow band and ultra-broadband designs ranging from 0.5 MHz to 50 GHz. connectors with 2.92mm, BNC, N,7/16 or SMA connector types, some regulars types are in stock, others 3 weeks fast delivery time,
RoHS and REACH compliant.
Pls. don't hesitate to contact us with a quote(sales@zysentech.com)
Power Dividers,Power Combiners,Rf Power Splitter,Rf Power Divider
Chengdu Zysen Technology Co., Ltd. , https://www.zysenmw.com