157x Filetype PDF File size 0.65 MB Source: dc-us.resource.bosch.com
Electric Drives Linear Motion and and Controls Hydraulics Assembly Technologies Pneumatics Service Drive & Control profile Understanding the IEC61131-3 Programming Languages It was about 120 years ago when Mark Twain used the phrase “more Choosing Your Language than one way to skin a cat.” In the world of PLC programming, The International Electrotechnical that cliché is still applicable today. Commission (IEC) identifies five Thanks to the International standard programming languages Electrotechnical Commission as the most common for both (IEC), five standard programming process and discrete programmable languages have emerged as the most controllers: Ladder Diagram (LD), common, used for both process and Function Block Diagram (FBD), discrete programmable controllers. Sequential Function Chart (SFC), The IEC is an organization Instruction List (IL), and Structured that prepares and publishes Text (ST) international standards for all electrical, electronic and related With the different programming technologies, including controllers. languages available, it’s important to With its IEC61131-3 publication, consider a few factors before deciding the organization identifies these The complexity of the application, the which to use for your application: five programming languages and capabilities of the PLC/PAC and the ability • Ease of maintenance by the final to transfer the program code are among their common abbreviations as: the key factors to consider with selecting user: SFC Ladder Diagram (LD), Instruction controller programming language. • Universal language acceptance: LD List (IL), Function Block Diagram • Acceptance in Europe: IL or ST (FBD), Structured Text (ST) and applications, and the multiplying • PLC speed of execution: IL or ST Sequential Function Chart (SFC). methods for implementing control • Applications mainly using digital functions. But many controls I/O and basic processing: LD Long dismissed as just being engineers may be wondering or FBD a European phenomenon, the about the characteristics of each • Ease of changing code: LD IEC’s programmable controller programming language. When • Ease of use by newer engineers: ST languages are gaining traction should one be used over another? • Ease of implementing complex in the United States. The IEC What are the benefits and mathematical operations: ST developed these programming disadvantages of each? This article • Applications with repeating standards in response to the will provide a brief overview and processes or processes requiring growing number of automation comparison of each of the five interlocks and concurrent vendors, the growing complexity of main PLC programming languages. operations: SFC Ladder Diagram (LD) This programming language, invented in the U.S. decades ago, is probably the most widely used. Invented to replace hardwired relay control systems, Ladder Diagram programming is a mainstay in the U.S. today, used in probably 95 percent of all applications. Visually, this language resembles a series of control circuits, with a series of inputs needing to be “made” or “true” in order to activate one or more outputs. Ladder Diagram language has experienced such widespread This language resembles a series of control circuits, with a series of inputs needing to be adoption that almost every “made” or “true” in order to activate one or more outputs. programmer in any country or industry can read and write this language. Because it resembles the fires an actuator to push the box be daunting — picture a ladder familiar electric circuit format, to another conveyor. Digital inputs rung with an output used in several even a non-programmer with an are checking for various conditions, phases of a process with many input electrical background can follow and a basic program is analyzing conditions attempting to control the program for purposes of the inputs and firing digital outputs exactly when that output needs to troubleshooting a problem. It’s also in response. There may be timers turn on. easy to start writing a program in the program, or some basic in Ladder Diagram. With just a comparisons or math, but there are Function Block Diagram basic outline of input and output no complex functions involved. Although Ladder Diagramming signals, one can sit down are start may be the most widespread churning out code. Most of the As the complexity of PLC language, a survey conducted by other IEC languages require more functionality has grown, however, Control Engineering magazine preparation, such as flowcharting Ladder Diagram language has several months ago highlighted all the potential process flows. been challenged to meet these growth in the use of programming Finally, most implementations advances and still maintain the languages other than ladder. of Ladder Diagram allow a paradigm of easy visualization and Function Block Diagram program to be organized into understanding. Functions such programming is an example. folders or subprograms that as PID, trigonometry and data Even though the adoption rate for are downloaded to the PLC, analysis are commonly required this language has recently slowed allowing for easy segmentation. in many control applications, but relative to other languages such as difficult to implement. Another Structured Text, Function Block Ladder Diagram programming is challenge is that as program size Programming is probably the ideal for a simple material handling grows, the ladder can become very second most widely used language. application, for example, where difficult to read and interpret, a sensor detects the presence of unless it’s extensively documented. In many ways, this graphical a box, other sensors check for Finally, implementing full language resembles a wiring obstructions, and then an output processes in Ladder Diagram can diagram even more so than Ladder code. With Function Block Diagram, the blocks are “wired” together into a sequence that’s easy to follow. It uses the same instructions as Ladder, but visually is more understandable to a viewer who is not versed in relay logic. The major advantage is that programs written in Function Block tend to be easy to follow — just follow the path! This language is ideal for simpler programs consisting of digital inputs, such as photoelectric sensors, and outputs such as valve manifolds, and could be appropriate in any application where Ladder is ideal. With Function Block Diagram, the blocks are “wired” together into a sequence that’s easy to follow. It uses the same instructions as Ladder, but is visually more understandable to a However, this language is not ideal viewer who is not versed in relay logic. for large programs using special I/O and functions. The large amount of turned off, and the next one in the necessary conditions are met to screen space required by this style sequence is active. The transition allow the program to advance to of programming can quickly make step also has code to check that the the next step. a program unwieldy if it reaches any substantial size. Also, writing a program in Function Block requires more preparation upfront to understand the program and how it will flow before any code is written, since it can be more difficult to make corrections later. Sequential Function Chart Sequential Function Chart (SFC) programming resembles the computer flowcharts that many will remember drawing up in their college days. An initial step “action box” (the starting point of a flowchart) is followed by a series of transitions and additional action steps. The concept of SFC is simple: an action box, with code inside written in any language of the programmer’s choice, is active In this example, SFC programming includes a flowchart on one side and two small until the transition step below it programs to the right. In an SFC program, the flowchart boxes (called actions) and the little horizontal lines with names (called transitions) actually have small programs running activates. The current action box is inside them. For appropriate applications which have a repeatable multi-step process or series of repeatable processes, this form of programming is the easiest to implement. An example would be a pick and place application, where product is constantly picked up from one area, moved through a specific path, and placed in another area. While exceptions exist, since there is typically only one active piece of code and one transition to be concerned with, condition checking and the control of the process should be achievable without large rungs. The language is also very friendly to maintenance engineers because the visual nature of the program plus code segmentation makes it easy to troubleshoot. For example, if the mechanism in a pick-and- place application has moved to Instruction List consists of many lines of code, with each line representing exactly the product but not picked it, the one operation. troubleshooter could bring up the program and look at the transition List, Function Block and Ladder programming will see similarities condition between the “move programs can easily be converted with Instruction List programming. to product” box and the “pick into each other, allowing a piece This language consists of many lines product” box to see what is holding of code to be displayed in the of code, with each line representing up the process. way most comfortable to the exactly one operation. Thus, it is user. Structured Text can also be very step-by-step in layout and On the downside, this style of converted into any of these three format, which makes the entry of programming is not suitable for languages, but SFC stands alone. a series of simple mathematical every application, as the structure It cannot be converted. Therefore, functions easy. In addition, if the that is forced on a program could you may want to consider this programmer uses only the IEC- add unneeded complexity. A large language only for end users who defined instructions, a program amount of time must be spent up are comfortable with the language written in this language can be front preparing and planning before and are unlikely to display it in a moved easily between hardware any programming is attempted different format, or for applications platforms. These advantages make or else the functions charts could where the hardware has the speed this language very popular in become unwieldy and difficult and memory necessary to store and Europe, a fact that is surprising to follow. The overhead required execute an SFC program. to many U. S. programmers who for this type of program causes it prefer the ease of maintenance to execute slower than the other Instruction List in the graphical languages, and languages. A final consideration Anyone who has experience place a lower premium in the is the inability to convert to programming microprocessors or transferability of programs. other languages. Instruction experience with Assembler language
no reviews yet
Please Login to review.