The function of the PLC instruction simulation module is to give certain meanings according to the syntax and semantic structure of the people who have read it, so that it has the function of the PIE CPU. For the instruction simulation module, its input is the various information contained in the syntax tree generated by the syntax analysis module. This part should be implemented according to the functions of different PLCs. The PLC program can be regarded as a source program written in a dedicated programming language (ladder diagram, statement list, etc.). It cannot be directly executed by the computer and must be translated into machine language. The simulation execution of the PLC program is a translation process of the PLC language, which is mainly implemented by two methods: compilation and interpretation. The interpretation method is used here, that is, interpreting and executing sentence by sentence. Every time the interpretation and execution of each sentence is completed, it is equivalent to the end of a scan cycle. Although the execution speed of this method is slower than the compilation method. But in general, it is still within the allowable range, and the interpretation method can be closer to the actual PLC cycle scanning working process, which is more convenient to observe and debug the program during the simulation process.
1. Design of PLC simulation software
Simulation technology has come along with the development of computer application technology. It is one of the powerful tools for analyzing, diagnosing and optimizing industrial production systems. Effectively designing control simulation systems and applying them to various practices can achieve low investment, good results and high efficiency. In the field of industrial control systems, as industrial production develops towards high speed, large-scale and automation, the application of a large number of major production equipment or process control equipment has increased the cost day by day, and the quality requirements for operating personnel are getting higher and higher. The simulation system can be basically close to the actual on-site control.
The simulation design of the control object includes two parts, namely the design of the simulation object and the design of the script program that controls the animation of the simulation object. The simulation interface (virtual controlled object) can be designed according to the functions of the specified style through the sub-picture connection, window connection or image processing method in the "KingView" software, and the system can be secondary developed based on the software according to the system requirements, and the animation and sound connection technology can be used to make the designed human-computer interface friendly and vivid.
2. Conversion from ladder diagram to instruction table
The ladder diagram is composed of many rungs. In the manual conversion process of the ladder diagram, the principle of top-down and left-to-right is followed, and the rungs are converted one by one. Therefore, the ladder diagram is essentially a directed graph. In the process of drawing the ladder diagram, the ladder diagram linked list is used to indicate the rows and columns where each component is located. The conversion process of the ladder diagram is based on the row and column coordinates of the component, and imitates the manual conversion thinking to convert the ladder diagram into a binary tree first, and then identify the corresponding instructions based on the binary tree. A ladder diagram can be regarded as a series and parallel connection between contacts or circuit blocks. The circuit block is essentially composed of two or more contacts. So it is essentially a series and parallel connection of contacts. The series connection is represented by the "+" sign, and the parallel connection is represented by the "+". As shown in Figure 1.
According to the principle of top-down and left-to-right, the ladder diagram can be converted into a binary tree. The binary tree is the key to converting the ladder diagram into an instruction list. Each rung corresponds to a binary tree. The binary tree clearly expresses the relationship between the contacts. By traversing the binary tree and combining the corresponding contact type, the instruction list is written.
3. Working principle of PLC simulation software
The principle of the simulation system based on configuration software is to link the status of various relays inside the PLC with the data in the configuration software database and the data with the graphic objects on the computer interface. When the PLC control system actually outputs control, it drives the external actuator through the output relay Y and the output module. The external control signal and feedback signal enter the PLC through the input relay X. In the simulation running state, the output module of the PLC is disconnected from the outside world, and the output (relay Y) signal is only exchanged with the data in the configuration software database through the communication line, and these data are related to the graphic objects displayed on the screen (interface).
When the states of the various points of the PLC output relay Y change, the data value in the database is changed. Then the corresponding graphic objects change, producing the simulation effect of simulating the actual object action that we require. At the same time, the input signal of the PLC must also be associated with the data in the database, through the mouse operation of the graphic object on the screen. Or the internal variable event of the configuration software triggers the change of the data in the database linked to it, and then changes the input signal. When writing the PLC program, it should be noted that the input signal to the PLC through the mouse operation of the graphic object on the screen, or the internal variable event of the configuration software is only a pulse signal. The simulation object of the configuration software can not only accept a variety of control signals such as digital and analog issued by the PLC, but also feedback various signals such as digital and analog to the PLC. Exchange various status data with the PLC, thereby reflecting the relationship between the operation of the PLC and the action results of the control object.
4. Conclusion
Programmable controllers (PLCs) are widely used in various fields of industrial control. Because PLCs are used for industrial field control, and PLCs are different from microcomputers, the execution results of the program cannot be observed through the display. The verification of the PLC program can only be achieved in combination with the controlled object. Therefore, the experimental link is very important. Since the current PLC operating system (system management software) is based on logical operations, it does not have system management capabilities. There is no good human-computer interface and the visibility is poor. If the configuration software is combined with the PLC control system. Based on the "King of Configuration" software. Secondary development is carried out, and the "King of Configuration" is used to perform animation configuration, hardware configuration and control configuration on the PLC. Through the computer to fully simulate the PLC experimental process. Simulate the experimental state of the PLC, the PLC simulation software system will surely be vigorously developed.
Previous article:Siemens PLC serial communication method
Next article:What is software redundancy? What is hardware redundancy?
Recommended ReadingLatest update time:2024-11-16 11:37
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Introduction to MSP430 development tools (JTAG SBW BS)
- There is nothing that cannot be embedded, only imagination can be used. Popular Science of Embedded Systems
- Partial Discharge in Switching Power Supplies
- The experiment got me all greasy:lol
- EEWORLD University Hall----Live Replay: Supporting 'Dual Carbon' - ADI Smart Factory Solution
- [Mil MYD-YA15XC-T Review] + Unboxing and Power-on Test
- The first case in China! A 72-year-old high-level paraplegic patient eats fried dough sticks and plays mahjong with his mind. Zhejiang University's brain-computer interface has achieved many firsts
- I made a website to download Keil, Cube and other resources. Does anyone want to try it? It's free and has no speed limit.
- Does leaving the charger plugged into the socket consume electricity?
- Choosing the Right RF Transceiver IC