Categories: Novice electricians, Books and video courses on electrical engineering and electronics, Industrial electrician, Programmable controllers
Number of views: 32688
Comments on the article: 5

PLC programming languages ​​and CoDeSys automation software platform

 

PLC, programming languages ​​and CoDeSys automation software platformTake the simplest example: you need to turn on the press 1 second after the operator simultaneously holds the two buttons in the pressed state. Thus, we guarantee that both hands of the operator are busy and give him time to monitor the readiness of the machine. The simplest solution is to connect the contacts of both buttons in series and put an electronic relay with a timer. If the timer allows adjustment of the delay time, then such a scheme will provide some flexibility of the system, but not too high.

Any additional conditions, for example, the requirement to control the sequence of button presses will put us in a difficult situation - we will be forced to change the circuit by introducing additional relays. This is not a difficult problem, provided that such a need arises extremely rarely.

But in conditions of competitive production, the time it takes for a new product to enter the market is crucial and therefore when it comes to flexible automated production, equipment readjustment must be carried out quickly, with minimal costs.

An additional problem is the increase in the complexity of the control system as production develops and additional functions appear (complications of the operation algorithm).

Any automation specialist also faced the problem of building a control system for equipment in that subject area that he is not familiar with enough: the lack of a clear statement of the problem, the emergence of new conditions as equipment is introduced, may make it impossible to successfully implement a project.

It was necessary to create a control device, the operation algorithm of which could be changed without redoing the wiring diagram of the control system, and as a result, a logical idea arose to replace control systems with “hard” logic of operation (a set of relays, regulators, timers, etc.) by automata with programmable logic of work. So born programmable logic controllers (PLCs). For the first time, PLCs were used in the USA to automate assembly line assembly production in the automotive industry (1969).

Since the definition of “programmable logic controller” was “programmable”, the question arose almost immediately, how to program the PLC?

Algorithmic programming languages ​​of computers of that time were oriented towards solving computational problems. The profession of a programmer was considered extremely rare and difficult; there were no such specialists at any production site. An ideal option would be to automatically translate circuit diagrams of relay machines into PLC programs.

Why not? So in the PLC appeared language of relay-contact circuits (RCS or LD in the English Ladder Diagram sources). The technologist could “redraw” the control circuit on the display of the PLC programming station. Naturally, the diagram was depicted not graphically, but by means of conditional symbols.

For example, the task described above could be programmed as follows:

contact relay language

On the left and right in such a program we see vertical power buses connected by horizontal circuits. Circuits can consist of their contacts and some additional elements (for example, a timer) connected in parallel or in series. To the right, each circuit ends with a relay coil. The contacts of this relay can in turn be present in other circuits. Thus, it is possible to make a rather complex circuit similar in functionality to a real relay circuit.

The first programming stations were very bulky devices transported by several people. Nevertheless, PLCs began to actively replace even more bulky and, most importantly, relay automation cabinets with “rigid” logic.

Physically, a PLC is one or more blocks having a specific set of outputs and inputs for connecting sensors and actuators (see Fig. 1).

The logic of its operation is described in software and is performed by the built-in microprocessor. As a result, exactly the same PLCs can perform completely different functions. To alter the operation algorithm, no hardware alterations are required.

PLC working principle

Fig. 1. The principle of operation of the PLC

The development of electronics has led to the stunning miniaturization of PLCs. Today there are miniature programmable controllers equipped with a small display and built-in programming capabilities, such controllers are called programmable relays. Typical tasks of programmable relays are very simple local systems having up to a dozen inputs and several power relay outputs.

Writing a more complex program using the built-in remote is not easy. Similarly, we can easily type SMS text on the keyboard of a cell phone, but even entering several pages of text, not to mention large volumes, seems problematic. For this, there are personal computers (PCs) that provide much more comfortable working conditions for people.


One modern PLC can replace dozens of regulators, hundreds of timers and thousands of relays. Using a PC to program such a system is not at all difficult. Using PC as a PLC programming station is the dominant solution today. This not only simplifies programming, but also solves the problems of archiving projects, preparing documentation, visualizing and modeling. The computer provides a convenient universal tool for programming the simplest local tasks on a PLC, as well as for an automatic process control system.

Please note that when talking about PLC programming, we always come back to how to make this process simple and convenient for humans. It would seem that once a programmed PLC will work for years and it is not very important whether its program will look beautiful, the main thing is that it works well.

Unfortunately, this is not the case. The need to change the program in the PLC arises regularly sometimes and unexpectedly. Therefore, it should be written so that any person, and not only its author, can quickly understand it and quickly make the necessary improvements. To say that the programs are written for the PLC is not entirely correct.

All programs are written by man and are intended for human reading. Any programming tools ultimately give the microprocessor instructions in its machine codes. There is no difference for him in what language the program is written.

Mentioned above LD language was invented in the USA during the period of relay automation. The fashion for PLCs came to Europe a little later, when relay cabinets were already successfully replaced with cabinets with logic circuits. Therefore, the need arose for inventing other programming languages ​​understandable to a new generation of engineers.

So in Germany there appeared languages ​​of simple text instructions resembling assembler (IL). In France, graphic functional block diagram languages ​​(FBD) and high-level diagrams describing stages and conditions of transitions (Graphset, modern SFC). The languages ​​used for programming computers (Pascal, Basic) were also used. In the late seventies, an extremely difficult situation developed.

Each PLC manufacturer (including in the USSR) developed its own programming language, therefore PLCs of different manufacturers were software incompatible, in addition there was a problem of hardware incompatibility. Replacing a PLC with a product from another manufacturer has become a huge problem.The buyer of the PLC was forced to use products of only one company or spend energy on learning different languages ​​and money on the acquisition of appropriate tools.

As a result, in 1979, within the framework of the International Electrotechnical Commission (IEC), a special group of technical experts on PLC problems was created. She was tasked with developing standard requirements for hardware, software, installation rules, testing, documentation and PLC communications.

In 1982, the first draft version of the standard was published, which received the name IEC 1131. Due to the complexity of the resulting document, it was decided to break it into several parts, the third part of the standard “PLC Programming Languages” is devoted to programming issues.

Since the IEC has switched to 5 digital notations since 1997, the correct name for the international version of the part of the standard devoted to the PLC programming languages ​​is IEC 61131-3. The IEC Working Group made a rather original decision. From the whole variety of PLC programming languages ​​that existed at the time of the development of the standard, 5 languages ​​that were most widely used were identified.

The language specifications were finalized so that it became possible to use a standardized set of elements and data types in programs written in any of these languages. This approach of the IEC has been criticized more than once, but time has proved the correctness of this decision.

The implementation of such an approach made it possible to attract specialists from various fields of knowledge (and, which is especially important, of different qualifications) to programming the same PLC: relay automation specialists (and even electricians), programmers in LD, specialists in the field of semiconductor circuitry and automatic control for whom the usual language is FBD, programmers with experience writing programs for computers in assembly language (it corresponds to the IL language for PLCs), in high-level languages ​​(ST language), even those far from Programming technologists got their programming tool - the SFC language.

Although the introduction of the IEC programming systems did not completely abandon the services of professional programmers (however, this goal was not set), but it allowed to reduce the qualification requirements and, accordingly, the cost of labor for PLC programmers. The standardization of languages ​​allowed (at least partially) to solve the problem of the dependence of the PLC user on a specific manufacturer.

All modern PLCs are equipped with IEC 61131-3 programming tools, which simplifies the work of controller users (you can use PLCs of various companies without retraining costs) and at the same time removes a number of problems for PLC manufacturers (you can use PLC components from other manufacturers).

The standard has significantly expanded the possibilities in the labor market of a specialist in PLC programming. Just as an auto mechanic with a standard set of tools can undertake repair of any part (except non-standard) of a machine of any company, a specialist who has studied the languages ​​of IEC 61131-3 will be able to figure out the program of any modern PLC. This made it possible to reduce both the dependence of the company on the PLC programming specialist, and the specialist on the company.

CoDeSys complex

Today, the leading position in the market for IEC programming systems is CoDeSys complex German company 3S-Smart Software Solutions GmbH. It is used by 190 companies worldwide, most of these companies are leading manufacturers of equipment and / or industrial automation systems.

In Russia, PLCs with CoDeSys are well known to specialists; the range of products manufactured under the control of these PLCs is huge. CoDeSys includes 5 specialized editors for each of the standard programming languages:

  • List of Instructions (IL),

  • Functional Block Diagrams (FBD),

  • Relay contact circuits (LD),

  • Structured Text (ST),

  • Sequential Function Charts (SFCs).

CoDeSys

Editors are supported by a large number of auxiliary tools that speed up program input. These are input assistant, automatic variable declaration, intelligent input correction, color highlighting and syntax control during input, scaling, automatic placement and connection of graphic elements.

In one project, you can combine programs written in several IEC languages ​​or use one of them. There are no special requirements for choosing a language. It is due solely to personal preferences.

The most popular language in Russia is ST. This is a text language, which is a slightly adapted Pascal. The second most popular graphic language is FBD, followed by LD. In addition to program preparation tools, CoDeSys includes an integrated debugger, emulator, visualization and project management tools, PLC and network configurators.

The embodiment of another unexpected idea, collectively generated by CoDeSys users, was the voluntary association of PLC manufacturers supporting CoDeSys into the non-profit organization CoDeSys Automation Alliance (CAA). The essence of the idea is to turn manufacturers of industrial automation products supporting CoDeSys into partners (as far as possible in a competitive market) and to neutralize the consequences of competition between manufacturers for PLC users.

Instead of deliberately creating technical obstacles that prevent users from easily using products of another company, CAA members deliberately take measures to ensure the compatibility of their products.

The user can be sure that his CoDeSys application will work in any controller of any company that is a member of the CAA. The user can be sure that the tools they use (CoDeSys) have been verified by thousands of users around the world. The user can always discuss their difficulties and get real help from a wide range of colleagues who have experience in solving such problems.

Brokarev A.Zh., Petrov I.V. Company "PROLOGUE"

See also at bgv.electricianexp.com:

  • Functional Block Diagram Language (FBD) and its Application
  • LD Ladder Language and its Application
  • Using ARIES PLC in automatic lighting control systems
  • Motor starting diagrams in the ladder diagram language LD for PLC
  • Programmable Logic Controllers for Home Automation

  •  
     
    Comments:

    # 1 wrote: | [quote]

     
     

    Useful article!

     
    Comments:

    # 2 wrote: | [quote]

     
     

    Who needs this whole story. Give specifics !!!

     
    Comments:

    # 3 wrote: | [quote]

     
     

    Thanks, it was interesting. And you know the specifics in the work))

     
    Comments:

    # 4 wrote: | [quote]

     
     

    Please write how the remotes for control relays are programmed, which are sold separately on Aliexpress.

     
    Comments:

    # 5 wrote: | [quote]

     
     

    Set out great, just understandable. Well done! Thanks! We would like to continue on various issues and areas, everyday, necessary.