PLC mainly works by running programs. In order to make the programmable controller play its full role, in addition to selecting the correct programmable controller model, suitable detection and execution devices, and rationally planning the system structure, it is also very important to compile a high-quality programmable controller working program.
1. Programming requirements
1. The program should comply with the relevant regulations of the PLC used. The main thing is to understand the instructions accurately and use them correctly. Various PLC instructions are similar, but there are also some differences. For those who have experience in using PLC, when choosing another unfamiliar model for programming, they must re-understand the instructions of the new model PLC, otherwise it is easy to make mistakes.
2. Make the program as concise as possible. A short program can save memory, simplify debugging, save time in executing instructions, and improve the response speed to input. To make the program short, you should pay attention to the programming method, use instructions well, use instructions cleverly, and optimize the structure. To achieve a certain function, generally speaking, when the purpose is the same, using instructions with strong functions may result in fewer program steps than using instructions with single functions.
3. Make the program as clear as possible. This will not only facilitate debugging, modification or supplementation of the program, but also make it easier for others to understand and read the program. To make the program clear, you must pay attention to the program level, modularization and standardization. Especially when compiling complex programs, you should pay more attention to the program level. You can accumulate your own experience and absorb others' experience, sort out some standard programs with typical functions, and make the program unitized as much as possible, like some commonly used subroutines in computers, which can be moved around and used. In this way, the design is simple and easy for others to understand.
5. The programmed program can run cyclically. The working characteristic of PLC is that it can run the same program repeatedly and uninterruptedly. The operation starts from the initialized state, and when the controlled object completes the working cycle, it returns to the initialized state. Only in this way can the controlled object get the same control in the new working cycle.
2. Programming methods Commonly used PLC programming methods include empirical method, analytical method and graphical method.
1. The empirical method is to use your own or other people's experience to design. Before designing, choose a successful example similar to the design requirements, and modify it, add or delete some functions or use some of the programs until it is suitable for your own situation. In the work process, you can collect and accumulate such successful examples, so as to continuously enrich your own experience.
2. The analytical method can use the theory of combinational logic or sequential logic and apply the corresponding analytical method to solve the logical relationship, and then draw a ladder diagram or directly write the program based on the solution. The analytical method is more rigorous and can use certain standards to optimize the program, which can avoid the blindness of programming and is a more effective method.
3. Graphical method Graphical method is to design by drawing. Commonly used methods include ladder diagram method, waveform diagram method and process method. Ladder diagram method is the basic method. Whether it is empirical method or analytical method, if the PLC program is converted into a ladder diagram, the ladder diagram method must be used. The waveform diagram method is suitable for time control circuits. After drawing the waveform of the corresponding signal, it can be easily designed according to the time logic relationship. The process method uses a block diagram to represent the execution process of the PLC program and the relationship between input conditions and outputs. When using step instructions, it is very convenient to use it for design.
Previous article:Method of measuring analog signal by using high-speed counter in S7-200PLC
Next article:Rules for using PLC ladder diagram
Recommended ReadingLatest update time:2024-11-16 13:02
- 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
- Solution to the problem that the zigbee terminal cannot reconnect
- FPGA learning experience - matrix keyboard
- Welcome the moderator "天意无罪" to take office~~
- Task stack overflow detection mechanism in FreeRTOS
- GaN RF Circuits and Applications
- How to quickly learn to use a chip?
- Lei Jun lost the 1 billion bet with Dong Mingzhu. It seems that the typhoon still can't blow up the pigs.
- The pad is 0.3mm/center distance is 0.5mm and the wire cannot come out
- C2000 Code Generation Tools - Compiler
- I want to use an I/O port of the STM32F1 chip to connect an infrared sensor at a distance of 3 meters. I am worried that the transmission distance is too long. How can I achieve this?