PLC currently has 5 standard programming languages, including graphical programming language and textual programming language.
Graphical programming languages include: Ladder Diagram (LD); Function Block Diagram (FBD); Sequential Function Chart (SFC).
Text-based programming languages include: Instruction List (IL) & Structured Text (ST).
The programming language of IEC 1131-3 is an international programming language standard for industrial control systems formed by the IEC working group on the basis of reasonable absorption and reference of programming languages of PLC manufacturers around the world. It is not only applicable to PLC systems, but also to a wider range of industrial control fields, making an important contribution to the global standardization of PLC programming languages.
Relay Ladder Diagram (LD)
The relay ladder diagram (LD) language is the first programming language used by PLC and is also the most commonly used programming language for PLC. The ladder diagram programming language evolved from the relay control system schematic diagram and is consistent with the basic idea of the relay control system ladder diagram, but there are certain differences in the use of symbols and expressions.
The original intention of PLC design was to be used by electrical technicians in factory workshops, in order to conform to the thinking habits of relay control circuits. As the first programming language used in PLC, ladder diagrams retain the style and habits of relay circuit diagrams, becoming the most easily accepted and used language by electrical technicians.
1. Soft relays Some programming elements in the PLC ladder diagram have adopted the name of relays, such as input relays, output relays, internal auxiliary relays, etc. However, they are not real physical relays, but some storage units (soft relays). Each soft relay corresponds to a storage unit of the image register in the PLC memory. If the storage unit is in the "1" state, it means that the coil of the corresponding soft relay in the ladder diagram is "powered on", its normally open contact is connected, and the normally closed contact is disconnected. This state is called the "1" or "ON" state of the soft relay. If the storage unit is in the "0" state, the state of the coil and contact of the corresponding soft relay is opposite to the above, and the soft relay is called the "0" or "OFF" state. These "soft relays" are often called programming elements in use.
2. Power Flow There is an imaginary "conceptual current" or "power flow" flowing from left to right. This direction is consistent with the order of logical operations when executing user programs. Power flow can only flow from left to right. Using the concept of power flow can help us better understand and analyze ladder diagrams.
3. Busbars The vertical common lines on both sides of the ladder diagram are called busbars. When analyzing the logical relationship of the ladder diagram, in order to borrow the analysis method of the relay circuit diagram, you can imagine that there is a DC power supply voltage between the left and right busbars (left busbar and right busbar), with positive on the left and negative on the right, and "energy flow" flowing from left to right between the busbars. The right busbar can be omitted.
4. Ladder diagram logic solution
According to the state and logical relationship of each contact in the ladder diagram, the state of the programming element corresponding to each coil in the diagram is found out, which is called the logic solution of the ladder diagram.
The logic solution in the ladder diagram is performed from left to right and from top to bottom. The solution result can be used immediately by the subsequent logic solution.
Logic solving is based on the value in the input image register, rather than on the state of the external input contacts at the moment of solving.
1. It corresponds to the electrical operation principle diagram, and is intuitive and corresponding;
2. It is consistent with the original relay logic control technology and is easy for electrical technicians to master and learn;
3. The difference from the original relay logic control technology is that the power flow in the ladder diagram is not the actual current, and the internal relay is not an actual relay. Therefore, when applying it, it needs to be treated differently from the relevant concepts of the original relay logic control technology;
4. There is a one-to-one correspondence with the instruction list programming language, which facilitates mutual conversion and program checking.
Function Block Diagram (FBD)
Function Block Diagram (FBD) uses graphic symbols similar to digital logic gate circuits. It has intuitive logic and is easy to use. It has instructions equivalent to the shocks and coils in ladder diagram programming and can solve a wide range of logic problems.
1. Taking functional modules as units and starting from the control function, it makes the analysis and understanding of the control scheme easier;
2. Functional modules describe functions in a graphical way. Its intuitiveness greatly facilitates programming and configuration for designers and has good operability.
3. For systems with large control scale and complex control relationships, since the relationship between control functions can be expressed more clearly, programming and configuration time can be shortened, and debugging time can also be reduced.
Sequential Function Chart (SFC)
Sequential Function Chart (SFC), also known as flow chart or state transition diagram, is a graphical functional description language specially used to describe industrial sequential control programs. It can be used to program systems with complex structures such as concurrency and selection.
1. Focus on functions, be clear and organized, and facilitate understanding and communication of program operations;
2. For large programs, the design can be divided into different tasks and a more flexible program structure can be adopted, which can save program design time and debugging time;
3. It is often used in situations where the system is large in scale and the program relationship is complex;
4. Only when the commands and operations of the active step are executed, the transition after the active step is scanned. Therefore, the scanning time of the entire program is greatly shortened compared with the scanning time of programs compiled by other programs.
Instruction List
The instruction list (IL-Instruction List) programming language is similar to the mnemonic assembly language in computers. It is the most basic programming language for programmable controllers. The so-called instruction list programming uses one or several easy-to-remember characters to represent a certain operating function of the programmable controller.
1. Use mnemonics to indicate operation functions, which are easy to remember and master;
2. Mnemonics are used on the keyboard of the programmer, which is easy to operate and can be used for programming in places without computers;
3. There is a one-to-one correspondence with the ladder diagram, and its characteristics are basically the same as the ladder diagram language.
Structured Text (ST)
Structured Text (ST) is a high-level text language that can be used to describe functions, function blocks and program behaviors, and can also describe the behavior of steps, actions and transitions in sequential function flow charts. Structured Text language is superficially similar to PASCAL language, but it is a programming language developed specifically for industrial control applications. It has strong programming capabilities for variable assignment, callback functions and function blocks, creating expressions, writing conditional statements and iterative programs, etc.
1. Using high-level language for programming can complete more complex control operations;
2. It requires certain knowledge of computer advanced programming languages and programming skills, and the skills required of programmers are relatively high, which ordinary electrical personnel cannot complete.
3. Poor intuitiveness and operability;
4. It is often used to implement some control functions that are difficult to implement in other languages such as functional modules.
Tip: Not all PLCs support all programming languages (for example, many low-end PLCs do not support function block diagrams and sequential function diagrams), but large PLC control systems generally support these five standard programming languages or similar programming languages.
There are some programming languages other than the standard ones. Although they are not selected into the standard languages, they are developed for applications in some special occasions. In some cases, they may be better programming languages. For example, the continuous function chart CFC of D7-SYS is specially developed for large-scale continuous process control. As long as the CFC function block in the program is called, a series of special functions such as PID controller, counter, positioner, ramp function generator, etc. can be easily realized, and no special programming knowledge is required. You only need to understand the use of graphical processing and standard program blocks and perform simple settings.
Talk about PLC learning methods
1. Learning PLC programming requires strong perseverance and enough patience
Everyone has their own strengths. Some people regard programming as a long and boring job; some people regard programming as an interesting intellectual game. If you are the former, it is strongly recommended that you stay away from this job. After all, programming is a challenge to people's perseverance and patience. Programming requires countless trials and errors, debugging-modification-debugging-modification... After countless failures, when you see the PLC running in an orderly manner according to your control requirements, you will get a great sense of accomplishment, just like clearing a level in a game, the feeling is the same.
Previous article:The difference between inverter dedicated filter and reactor
Next article:Introduction to Siemens PLC programming language
Recommended ReadingLatest update time:2024-11-16 09:24
- 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
- How to expand the BIM code space of CC2640 SDK sample code
- Sound Level Meter MASTECH MS6700 Disassembly Pictures and Information
- Design of Multi-channel Data Acquisition System Based on CPLD
- EEWORLD University Hall----Underactuated Robotics MIT 2019 spring 6.382
- Let's talk about what technologies we can use to help in the face of this pneumonia virus? ? ?
- EEWORLD University Hall----C2000 series new products bring convenience to servo and motor drive systems
- Wireless positioning principle: TOA&AOA
- MSP430F149 IO port
- MKL26 accelerator debug error, which god can help me take a look
- Old Iron