[Introduction] The function of PLC automatic sequence is to control the equipment to work according to the pre-designed process flow. There are also several methods for writing the process of PLC automatic program. Let's make a detailed explanation below.
The first method: the reset method of the auxiliary relay
This method is the most primitive and simplest way of writing. For example, the first step is to set M0. After M0 is turned on, a certain result is controlled. After the result is achieved, M0 is reset, and then M1 is set, and the process control is carried out in sequence. This writing method is common to all PLCs.
Second method: using step numbering
Using integer variables as step numbers is easy to understand and maintain. Operations such as step increase, decrease, and jump are convenient, simple, and easy to understand. When resetting, just change the variable value to 0. When programming, please note that when the conditions of consecutive steps are true at the same time, the step number will increase continuously in one PLC cycle until the last non-conducting step instruction, and other programs triggered by the step number will not be executed. This situation is easy to miss during debugging.
The third type: GRAPH (sequential function flow chart language, also known as SFC)
This method is very similar to our equipment process flow chart, and is also the most intuitive program. It looks very clear what the first step is and what conditions are required to start the second step. Although the program looks very clear on the surface, the actual operation process of writing project programs is not simple. It takes time to become familiar with this writing method. In addition, this method is not universal for all PLCs (for example, Siemens S7-1200 does not support it, only S7-1500 supports it). In addition, it has high requirements on PLC performance and occupies a large amount of working memory.
Fourth: shift instruction method
This method uses the shift principle of shift instructions to achieve step control, such as Omron's SFT instruction, Mitsubishi's ROL, ROR, etc., and Siemens' shift instructions are similar. The difficulty of this method is to understand the working principle of the shift instruction, which is also common to all PLC programming.
Fifth: DECO decoding instruction method
Decoding instruction DECO: converts the integer to the corresponding position 1 in Dword, and when the step sequence changes, the PLC will definitely re-execute a scan cycle, and will not jump multiple steps continuously. It avoids the situation where the instructions triggered by the step sequence in the program are not executed. Jump and reset operations are simple to write. For example, Siemens S7-1200PLC can support DWORD decoding (32 bits), and S7-1500 can support LWORD decoding (64 bits).
Sixth: Method of assigning work and state variables
This method combines data transfer instructions with comparison instructions to achieve program flow step conversion. I personally think this method is the easiest to understand and the simplest to operate. It is recommended for beginners to try it. Of course, this method is also common to all PLCs. Set two variable words, state word and work word. The bit in the state word is used as the step mark, and the work word is used as the jump target step mark. When the condition corresponding to the step bit in the current step state word is met, the bit corresponding to the next step in the work word is triggered. Then, when the PLC sequentially scans to the transfer instruction, the value of the work word is assigned to the state word to complete the step jump. The advantage is that there is no set and reset operation. There is only one position 1 at the same time. When jumping, just set the corresponding position in the work word to 1. When resetting, clear the state word and work word to zero, and the program will automatically light up the first bit in the state word. When the step sequence is greater than 16, it can be changed to DWORD or the number of words can be increased to increase the step sequence.
Seventh: SCL programming method
More and more small PLCs support SCL language, which is a high-level programming language similar to PASCAL. Commonly used programming statements such as FOR, IF, WHILE, CASE, etc. can be combined to write very powerful algorithms and logics. More and more people use this writing method. Using SCL to design automatic programs mainly combines CASE and IF statements, and uses Step as the program number. If there are relatively long branches or parallel actions, multiple Step program steps are required, which will not be discussed here.
Previous article:Tips for Designing Efficient AC Motor Drive Systems
Next article:What is the difference between a variable frequency motor and an industrial frequency motor?
- 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.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- 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
- Make ADAS technology more popular in vehicles
- What is a hysteresis comparator?
- VICOR DCM2322 isolated regulated DC-DC converter is now available for free!
- Zigbee learning notes---protocol stack NV operation
- Required selection: 1.5V lithium rechargeable button battery Rated voltage (V) 1.5V
- GD32E231 analog IIC driver LSM6DSO
- Single Voltage Reference vs. Dual Voltage Reference - I
- Basic C language programming specifications for microcontroller development
- [N32L43X Review] 2. Simulating I2C to drive OLED
- I'm stuck while learning about op amps and have encountered several problems, as shown in the picture. Forum friends who know the answer please help me analyze it. Thank you.