Programmable logic controllers (PLCs) utilize various programming languages , including ladder diagrams, Boolean mnemonic languages, function list diagrams, function block diagrams, and structured statement description languages. Ladder diagrams and Boolean mnemonic languages are fundamental programming languages, typically consisting of a series of instructions. These instructions can perform most simple control functions, such as replacing relays, counters, and timers to perform sequential and logic control. By extending or enhancing the instruction set, they can also execute other basic operations.
Function block diagram (FBM) languages and statement description languages are high-level programming languages that can perform more efficient operations as needed, such as analog signal control, data manipulation, report printing, and other functions that basic programming languages cannot accomplish. FBM languages use function block diagrams to implement the required control functions through soft connections. They are widely used not only in programmable logic controllers (PLCs) but also frequently employed in the programming and configuration of distributed control systems (DCS). Due to their convenient connection, simple operation, and ease of learning, they are favored by many engineering designers and application personnel.
Depending on the application scope of the programmable, programming languages can be used in combination. Commonly used programming languages include: ladder diagram programming language, Boolean mnemonic programming language (statement list), function table diagram programming language, function block diagram programming language, structured statement description programming language, ladder diagram and structured statement description programming language, Boolean mnemonic and function table diagram programming language, and Boolean mnemonic and structured statement description programming language.
1. Ladder Diagram Programming Language
Ladder diagram programming language is a programming language that uses the graphical notation of ladder diagrams to describe programs. In ladder diagram programming language, programs are described in the form of ladder diagrams. This programming language uses cause-and-effect relationships to describe the conditions and results of events. Each rung of the ladder represents a cause-and-effect relationship.
In a ladder diagram, the conditions describing an event are represented on the left, and the result of the event is represented on the right. Ladder diagram programming language is one of the most commonly used programming languages. It originates from the description of relay logic control systems. In the field of industrial process control, electrical technicians are quite familiar with relay logic control technology; therefore, ladder diagrams, developed from this logic control technology, have become popular and widely used.
The characteristics of ladder diagram programming language are:
(1) It corresponds to the electrical operation schematic diagram, and is intuitive and corresponding;
(2) It is consistent with the original relay logic control technology, which is easy for electrical technicians to grasp 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 is necessary to distinguish it from the relevant concepts of the original relay logic control technology.
(4) It has a one-to-one correspondence with Boolean mnemonic programming languages, which facilitates mutual conversion and program inspection.
2. Boolean Mnemonic Programming Language
Boolean mnemonic programming languages are programming languages that use Boolean mnemonics to describe programs. They are very similar to assembly languages in computers, using Boolean mnemonics to represent operational functions.
Boolean mnemonic programming languages have the following characteristics:
(1) Using mnemonics to represent operation functions makes them easy to remember and easy to grasp;
(2) The programmer uses mnemonic symbols on the keyboard, which is easy to operate and can be used for programming design in the absence of a computer;
(3) It has a one-to-one correspondence with the ladder diagram. Its characteristics are basically the same as those of the ladder diagram language.
3. Sepuential Function Chart (Programming Language)
Function chart programming language is a programming language that uses function charts to describe programs. It is a programming language that has been developed in recent years. Using function charts, the control system is divided into several subsystems. Starting with functions, the operation of the system has a clear meaning, facilitating communication between designers and operators, and simplifying program design, division of labor, and debugging.
The characteristics of the function chart programming language are:
(1) The program is organized around the main functions, making it easy to understand and communicate the operation of the program.
(2) For large programs, the design can be divided into different parts, 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 relationships are complex;
(4) The scanning of the transition after the active step is performed only when the commands and operations of the active step are executed. Therefore, the scanning time of the entire program is much shorter than that of other programs.
Function list diagrams originate from Petri nets. Because of their graphical representation, they can relatively easily and clearly describe all phenomena in concurrent and complex systems, and can analyze and model anomalies such as deadlock and insecurity within the system. Programming can then be directly performed based on these models, leading to their widespread application. In recent years, programmable logic controllers (PLCs) and small distributed control systems have also provided software for programming using function list diagram description languages. I will introduce some basic concepts of Petri nets later to facilitate a further understanding of function list diagrams.
4. Function Block Diagram Programming Language
Functional block diagram (FMT) programming languages use functional modules to represent the functions of modules. Different functional modules have different functions. Each module has several input and output terminals, which are connected to other required terminals via soft connections to complete the required control operations or functions. Functional modules can be divided into different types, and even within the same type, different functional parameters can lead to differences in function or application scope. For example, differences in the number of input terminals or the type of input signals affect their application range. Because soft connections are used to connect functional modules to each other and to external terminals, changes to control schemes and replacements of signal connections can be easily implemented.
The characteristics of functional block diagram programming languages are:
(1) Taking the functional modules as units, starting with the control function, makes the analysis and understanding of the control scheme easier;
(2) Functional modules describe functions in a graphical way. Their intuitiveness greatly facilitates programming and configuration for designers and has good operability.
(3) For systems with a large control scale and complex control relationships, the programming and configuration time can be shortened and the debugging time can be reduced because the relationship between control functions can be expressed more clearly.
(4) Since each functional module requires a certain amount of program memory and the execution of the functional module requires a certain execution time, this design language is only used in the programming and configuration of large and medium-sized programmable controllers and distributed control systems.
6. Structured Text describes programming languages
Structured programming languages (SPLs) are programming languages that use structured statements to describe programs. They are similar to high-level programming languages. In large and medium-sized programmable logic controller (PLC) systems, SPLs are commonly used to describe the relationships between variables in the control system. They are also used for programming and configuring distributed control systems.
Structured programming languages use computer-defined statements to describe the various operational relationships between variables in a system, completing the required functions or operations. Most manufacturers use statement-based programming languages similar to high-level languages such as BASIC, PASCAL, or C, but for ease of use, they have simplified the expression methods and types of statements.
Structured programming languages have the following characteristics:
(1) Using a high-level language for programming allows for the completion of more complex control operations;
(2) It requires knowledge of advanced computer programming languages and programming skills, which places high demands on the skills of programmers and cannot be completed by ordinary electrical personnel.
(3) Poor intuitiveness and ease of operation;
(4) It is often used to implement some control functions that are difficult to implement using other languages such as functional modules. Some programmable controller manufacturers provide users with a simple structured programming language, which is similar to a mnemonic programming language. It has certain limitations on the number of program steps, and at the same time, it provides a way to write the interface or communication connection program with the programmable controller, providing room for expansion of the user's application program.