Basics of programming controllers in high-level languages. PLC programming What's inside these glands?

The controller is a control device. It only becomes truly functional when you create and run a program to use it.

This implies the main task of a programmable logic controller - the execution of a program that manages the technological process.

What software package is available for the PLC? In principle, any set is possible. The main thing is that the size of free resources of this instrument, was not a hindrance to you. The developer gets ample opportunities to write programs.

What is needed to program the controller? Firstly, you need a programmer who would thoroughly understand this issue. Secondly, you need the computer itself and, of course, a development package.

Development tools functionality

Typically the development package comes with additional fee. Although, in principle, it often occurs that Current Package already initially included in the installation software.

What functionality does the development environment offer?

  1. A large set of libraries, program blocks, specific procedures and ready-made templates.
  2. Tools for checking, testing and running a program on a computer bypassing the controller.
  3. A tool is also proposed to automate the documentation of the program that was created, within the accepted standards.

And finally, it is necessary to note the main advantage - it supports about six programming languages. The only drawback is that program compatibility is implemented at a low level. PLC manufacturers have not come to unification and each produces this device, with its own software environment.

Types of programming languages ​​for PLC

  • Language LD

LD (Ladder) is a graphics-based development environment. In a way, it is like a relay circuit. Developers of this standard They believe that the use of this type of software environment significantly facilitates the retraining of relay automation engineers on PLCs.

The main disadvantages of this programming language include inefficiency when processing processes with a large number of analog variables, since it is built to represent discrete processes.

  • FBD language

FBD (Function Block Diagram) – Graphical programming is also used here. Figuratively speaking, FBD defines a certain multiplicity of functional blocks that have connections among themselves (input and output).

Communication data is variable and transfers between blocks. Each block individually can represent a specific operation (trigger, logical “or”, etc.). Variables are defined using specific blocks, and output circuits can have connections to specific controller outputs or connections to global variables.

  • SFC language

SFC (Sequential Function Chart) – can be used with ST and IL languages, it is also graph based. The principle of its construction is close to the image of a finite state machine; this condition classifies it as one of the most powerful programming languages.

Technological processes, in given language, are built according to the type of certain steps. The structure of the steps consists of a vertical line that goes from top to bottom. Each step is a specific operation. You can describe an operation not only using SFC, but also using ST and IL.

Once a step is completed, the action of transferring control to the next step occurs. The transition between steps can be of two types. If some condition is met at a step and the further action is to move to the next step, then this is a conditional transition. If all the conditions at a given step are fully met and only then the transition to the next step occurs, then this is an unconditional transition.

  • Language ST

ST (Structured Text) is a high-level language and has many similarities with Pascal and Basic.

ST allows you to interpret more than sixteen data types and has the ability to work with logical operations, cyclic calculations, etc.

A minor drawback is the lack of a graphical environment. The programs are presented in text form and this condition complicates the development of the technology.

  • IL language

IL (Instruction List) - a language similar to Assembly, usually used to encode blocks individually. The advantage is that these blocks have high operating speed and low resource requirements.

  • CFC language

CFC (Continuous Flow Chart) – refers to high-level languages. In principle, this is a clear continuation of the FBD language.

The design process consists of using ready-made blocks and placing them on the screen. Next, they are configured and connections are placed between them.

Each block is the control of a specific technological process. Here the main focus is on the technological process, mathematics fades into the background.

In production it is carried out by technological personnel, therefore generally accepted programming languages ​​for microprocessors and personal computers are not suitable for programming industrial controllers, as they require special skills and knowledge from personnel. Involving third-party engineering companies in programming often leads to the end user's attachment to a specific contractor. Therefore, programming requires more understandable, simple and visual programming languages ​​that are open to general use. In 1979, a special group of technical experts was created within the International Electrotechnical Commission (IEC or IEC) to cover issues including hardware, installation, testing, documentation and communications. The result of the work of this commission was the release of the IEC 1131 standard in 1982. The modern edition of the standard (which since 1997 has been called IEC 61131) includes 8 sections:

  1. General information.
  2. Requirements for equipment and tests.
  3. Programming languages.
  4. User manuals.
  5. Message specification.
  6. Field networks.
  7. Fuzzy logic programming.
  8. Guidelines for the use and implementation of PLC languages.

Section 3 of this IEC standard (IEC 61131-3) regulates the use of five standard PLC (industrial controller) programming languages: function block language (FBD), ladder logic (LD), sequential functional diagrams(SFC), Instruction Language (IL) and Structured Text Language (ST). The choice of these languages ​​is due to the simplicity and clarity of the representation of control algorithms with their help. The introduction of the IEC 61131 standard provided the basis for the creation of a unified school for training specialists in the field of PLC programming. Also, after the appearance of the standard, it became possible to create hardware-independent libraries.

Brief characteristics of standard programming languages ​​for industrial controllers (PLCs)

Ladder Logic Language (LD)

Ladder logic language is used to describe logical expressions various levels of complexity using electromechanical elements (relays and contacts). In the language of relay logic, logical operations such as AND, OR, NOT are implemented most simply and clearly. The LD programming language also provides for the execution of conditional transitions between program blocks.

Sequential Function Chart (SFC) language

Implements a sequence of procedural steps and conditional jumps. Each step performs a specific action programmed by the user. The transition between steps occurs after the logical conditions assigned to these conditional transitions are satisfied.

Instruction Language (IL)

Text language low level. The programming principle, commands and command recording structure are the same as in assembly languages. The instruction language (IL) is standardized and independent of the hardware platform used. Each instruction can contain four fields, separated by spaces or tabs. The structure of command recording in the instruction language is as follows:

<Метка> : <Оператор> + <Модификатор> <Операнд> <Комментарий>

The label, modifier, and comment in the instruction line are optional and are specified as needed. The operator must always be present in the string, but the operand may sometimes be absent. A label is a symbolic name (address) of some memory area in which the number of the line marked with the label in the list of commands is stored. The label must be followed by a colon. Together with labels, conditional (executed when certain conditions are met) and unconditional (always executed) jump commands (JMPC or JMP operators, respectively) are used. Transitions must be used carefully enough to avoid an endless loop. An operator is a direct command that performs a specific action on an operand. Together with the operator, a modifier may be present, which is intended to convert the operator to the required form. So the N modifier inverts the operand before executing the command itself, and the C modifier adds a check for the contents of the accumulator and executes the statement only if the value in the accumulator is true.

Structured Text Language (ST)

Structured Text Language is a high-level text-based programming language for creating flexible data processing procedures. The structure of this language is similar to Pascal. Structured Text (ST) language is based on expressions, each of which must end with a semicolon. To assign values ​​to variables, use the “:=” operator. Common symbols are used to describe mathematical expressions: +, *, /, (,),<, <=, >=, >, etc. The order of evaluating expressions is the same as in algebra - actions are performed from left to right. The operations enclosed in parentheses are performed first, then the operations of multiplication or division are performed, and only after that the operations of addition or subtraction are performed. For increase functionality structured text language it provides selection operators (IF ... THEN ... ELSE ... ENDIF), multiple selection operators (CASE ... OF ... ELSE ... ENDCASE), loop operators (WHILE ... DO ... ENDWHILE, REPEAT ... UNTIL ... ENDREPEAT or FOR ... TO ... BY ... DO ... ENDFOR) .

At the end of the article, it is worth mentioning the peculiarities of programming industrial controllers (PLCs). When programming a PLC, you should always remember that programs in an industrial controller are executed cyclically, and the execution time of one cycle can be fixed or asynchronous ( new cycle starts immediately after the end of the previous cycle). The program execution algorithm is as follows. At the first step, the PLC receives the information necessary for processing about the state of the control object - the input variables are read (inputs of analog and discrete input modules). Next, the received information is directly processed - the main PLC program is executed. As a result of information processing, control commands are generated, which in the next step are transmitted to the outputs of the industrial controller - the procedure for updating output variables.

15 09.2016

Before programming a PLC in the CoDeSyS 2.3 development environment, beginners often ask themselves: What systems need to be installed to work correctly with the device? How to configure the controller inputs and outputs? How to connect the device to a PC? And again, but how, and how?? We all understand that the devices are complex and the algorithms are voluminous, and it will take time to study. I’m thinking, maybe I should write a small book and call it codesys for dummies? Do you agree?

From this article you will learn:

Hello dear colleagues and guests. The author of the blog site, Gridin Semyon, is writing to you, and in this article I will tell you how to program the controller correctly. The topic is quite relevant, I hope after reading the article, some questions will disappear by themselves. =)

How does a PLC work?

PLC (programmable logic controller) is a device that fully automates the operation of devices, various units and machines. In fact, this is a kind of block that contains inputs and outputs for connecting sensors and actuators. Logic is written inside.

Calculations in the device are performed cyclically. That is, the same program execution actions are performed in a short period of time.

In one cycle performed by the device the following operations are performed:

  1. Start of the cycle;
  2. Reading input status;
  3. Execute user code;
  4. Recording output status;
  5. Maintenance of hardware resources;
  6. Execution system monitor;
  7. Cycle time control;
  8. Go to the beginning of the cycle;

I won't rant any more about theory. Let's get straight to practice.

What does the software package for full work with PLC consist of?

Of course, at first it will seem to you that you need to know too much in order to connect the main application and utilities with each other, and then connect the device. I want to tell you that there is nothing complicated in the process of installation and connections. My article will help with this.

First we need to install the main distribution CoDeSyS 2.3 c official website of ARIES. Ah, I suggest in many programming posts to use the device ARIES PLC63. Since this universal device with screen. It has on board both discrete inputs, analog inputs, and relay outputs.

So, download the program:

The standard installation procedure then follows. We indicate the path and press “Next”, “Next” all the time.

The next step will be setting targets for the PLC. Target is a certain description about the PLC configuration. The instructions tell CoDeSyS 2.3 how many and what inputs/outputs the device has.
We also download from ARIES website. I recommend installing all the targets that are there. So that you don’t have to search and think about it later if you have to write the algorithm on another PLC.

Let's launch automatic installer, install instructions. That's it, we've already done half the way in this work! After all these procedures, you can install libraries, but more on them later. Let's move on to the next point.

Working window of the program

We have installed the distribution, and the targets too. Let us take a look at the working window of the development environment, menu items and main tabs.

The main field in the figure above is divided into three areas:

  1. Editor of variables and their types;
  2. Tree of objects;
  3. Editor of the main program algorithm;

Variable Editor -Here we enter variables and assign data types to them. For those who don't know, a variable is a name that a program will access and return a result. And the data type determines the type of information, the range of representation of numbers and many other operations.

Object tree -This window contains objects such as functions, function blocks, subroutines, PLC configuration, libraries. I'll talk about this later.

Program editor -Here we describe the main algorithm of the controller’s operating program. Can be written in any IEC standard language. In more detail, you can article.

Simple example on ST

For ease of perception of information, I tried to structure it. I described the sequence of actions step by step. If you have any questions or suggestions, be sure to write in the comments.

Initially, I will post code in the ST language in the article. The logic of operation is as follows: a signal is supplied to the discrete input of the device and, after a time delay, the output is turned on. In principle, the problem is simple, and we will solve it with you.

Code codesys2.3

PROGRAM PLC_PRG VAR T1:TON; ("timer") Timer_Ust:WORD:=5; ("timer setting") Time_tekuch:TIME; (" current time") END_VAR T1(IN:=Start , PT:=DWORD_TO_TIME(Timer_Ust*1000)); Time_tekuch:=T1.ET; IF T1.Q THEN Out:= 1; ELSE Out:=0; END_IF;

PROGRAM PLC_PRG

T1: TON; ("timer")

Timer_Ust: WORD: = 5; ( "timer setting")

Time_tekuch: TIME; ("current time")

END_VAR

T1 (IN: = Start, PT: = DWORD_TO_TIME (Timer_Ust * 1000));

Time_tekuch: = T1. ET;

IF T1. Q THEN Out := 1 ; ELSE Out := 0 ;

END_IF ;

We launch our distribution, create new project, indicate the target we need. Do not forget to first check that you have installed the drivers for the USB-COM converter; we will need it for communication.

The listing contains two global variables Start and Out. They are associated with physical inputs and outputs. We make all the settings in the PLC configuration tab.

We compile the project (we check it for the relevance of the code so that there are no errors). You can press the F11 button.

Enter required settings connections, as in the picture.

Let's assemble our logic programmable controller circuit. We connect the RS-232 interface on one side and USB on the other. Click “connect”. We feel joy from the process. =))If a communication error occurs, then check all connections and parameters again. It often happens that the converter wire is broken.

I recorded the whole process on video in case anything is unclear.

In the next article I will write about, don’t miss it. It will be interesting.

Successful implementations, dear readers and guests. If you liked the article, subscribe to the blog news and tell your friends. What language and equipment do you prefer to use to build an automation system?

Best regards, Gridin Semyon.

For PLC programming, the International Electrical Commission (IEC) has developed the IEC 6-1131/3 standard, which defines 6 programming languages:

· CFC (Continuous Function Chart);

SF C(Sequential Function Chart);

· FBD(Function Block Diagram);

· LD(Ladder Diagram);

· ST(Structured Text);

· IL(Instruction List).

Four first CFC, SFC, LD and FBD languages ​​use graphical notation - executed commands, operations and functions are represented graphically, like diagrams.

Last two language(ST, IL) are text. They empower programmers.

Using IEC 61131-3 languages, not only automation tasks are programmed, but also human-machine interface (HMI) algorithms.

IEC 6-1131/3 languages ​​combine functionality and simplicity. They also protect the user from most errors that often occur when using conventional programming languages. Implementation of IEC 6-1131/3 in an integrated HMI system is not only meets the requirements of the standard, but also provides the user with an additional service in the form of an expanded set of libraries of functional blocks that implement standard control algorithms.

For all six languages ​​there is single mechanismconnection with real-time database. According to this mechanism, each program must have a set of arguments. The input data is passed to the program through input arguments, and the results of calculations are returned in output arguments. Arguments are associated with channel attributes, that is, with real inputs and outputs of controllers, with interface devices, cells of corporate databases, as well as with internal variables. Thanks to this design, the same program can be called several times per cycle to process different data streams.

Programming and debugging of programs in IEC 6-1131/3 languages ​​is carried out in integrated development environment , which includes several different editors. Programs in the FBD, LD, CFC and SFC languages ​​are created and debugged in special visual editors , and ST and IL – in a text editor .

Despite the differences, the programs different languages IEC 6-1131/3 standard can to interact between themselves. For example, an FBD program can call a function block written in the ST language, and inside this block a subroutine in LD can be called, etc. Such flexibility in the choice of means for describing algorithms allows both a programmer, a technologist, a setup engineer and a business consultant to work effectively on one task, when each of them performs his part of the work in a way convenient for him.

SFC language. In the IEC family of languages, SFC diagrams (Sequential Function Chart) are high-level graphic a tool that uses the ideas of Petri nets. Thanks to SFC, a graphical representation of a system model turns into a complete program.

Start practical implementation The SFC language for PLCs belongs to French companies. Collaboration PLC manufacturers and users led to the emergence of the national standard “Grafset”, and then the international standard IEC 848 (1988). The latest IEC 61131-3 standard borrows Grafset with some modifications.

SFC it is a powerful means of structuring complex algorithms. In fact, SFC is not an independent language. Translated from English, the abbreviation SFC can be translated as “functional sequence diagram”. Externally, the SFC program is similar to block diagram of the algorithm (Fig. 2.1), which displays individual program blocks (steps), transitions between them and the conditions under which these transitions are performed.

Figure 2.1 – Example of program representation in SFC language

Transitions in SFC have a pronounced top-down direction and are reflected by straight lines. Positions in the SFC are called steps or in stages. They are displayed in the diagram as rectangles. Thanks to this representation, it is possible to implement diagrams in pseudographic symbols. It is impossible to specify several starting steps in SFC; only one diagram step is the starting step. Each program block, like each transition condition, is a subroutine in any of the languages ​​of the IEC 6-1131/3 standard. The SFC diagram makes it possible to quickly build a prototype of a system without programming, since it does not require detailed description actions and binding to specific hardware.

This language is very convenient for programming batch processes, dosing systems and business applications. SFC can be used by both engineers and business analysts.

Language FBD . Language FBD intended for process engineers, problem solvers process control. It provides a visual tool for programming control and regulation loops. An FBD program is a circuit consisting of a set of functional blocks interconnected through inputs and outputs (Fig. 2.2).

Figure 2.2 – Example program in FBD language

The software systems have more than 150 standard functional blocks that implement a wide range of functions - from the simplest logical operations to the finished adaptive controller. Standard FBD blocks implement the functions of filtering, PID control, modal, fuzzy and positional control, PWM conversion, as well as control blocks for valves, gate valves, motors, etc.

Ladder Diagram LanguageLD(Ladder Diagram) or relay diagrams(RKS) is a graphical language that implements the structures of electrical circuits.

RKS is an American invention designed to replace relay automation of assembly lines with programmable controllers. The RKS language made it possible to solve problems of transparent transfer of relay circuits to PLCs. Various options software implementation of relay circuits were created by almost all leading PLC manufacturers. Due to the simplicity of presentation, the RKS language has gained popularity, which was the main reason for its inclusion in the IEC standard.

The words “ladder logic” sound quite archaic today, but relay technology is still widely used.

Graphically, the LD diagram is presented in the form of two vertical power buses. Between them there are circuits formed by connecting contacts (Fig. 2.3). The load for each circuit is a relay. Each relay has contacts that can be used in other circuits.

Figure 2.3 – Representation of a relay diagram in LD language

Logically sequential (AND), parallel (OR) connection of contacts and inversion (NOT) form a Boolean basis. Therefore, the LD language is ideal not only for constructing relay machines, but also for software implementation of combinational logic circuits. Due to the ability to include functions and functional blocks written in other languages ​​into a program in the LD language, the scope of application of the LD language is practically unlimited.

IL instruction language. The IL language (Instruction list, literally “list of instructions”) is a typical assembler with an accumulator and jumps by labels (Fig. 2.4). The set of instructions is standardized and does not depend on a specific target platform.

Before the adoption of the IEC standard, there were a number of varieties of this language, including those with Russian abbreviations.

The programming language STEP of Siemens controllers had the greatest influence on the formation of modern IL.

The IL language allows you to work with any data types, call functions and function blocks implemented in any language. Thus, an algorithm of any complexity can be implemented in IL, although the text will be quite cumbersome.

Figure 2.4 – View of the IL program in the CoDeSys editor window

As part of the IEC languages, IL is used to create compact components that require careful development, which takes a lot of time. When working with IL, you can imagine what the translated code will look like much more clearly than with other languages. Thanks to this, IL wins where the highest efficiency needs to be achieved.

Structured Text Language ST. ST (Structured Text) language is a high-level language. Syntactically, ST is a slightly adapted Pascal language. Instead of Pascal procedures, ST uses IEC program components.

For specialists familiar with the C language, mastering ST will also not cause any difficulties. As an illustration, let's compare equivalent programs in the ST and C languages:

WHILE CounteroO DO while (Counter – ! = 0)

Counter:= Counter-1; (

Varl:= Varl*2; Varl *= 2;

IF Varl > 100 THEN if (Varl > 100)

Var2:= Var2 + 1; Varl = 1;

Most PLC programming packages offer the ST language by default to describe the actions and conditions of SFC transitions.

2.4 Design packages that support the standard
IEC 61131-3

Unlike simple controllers, the programming of which usually comes down to specifying a set of constants and is carried out from the built-in or remote control panel, specialized ones are used for programming universal-purpose logical controllers software systems.

Thanks to the openness of the IEC standard, a number of specialized companies have emerged that deal exclusively with PLC programming tools. The programming systems of these companies have certain differences, which are concentrated only in the implementation of the interface - in the style of graphics, in the set of service functions, in the content of additional libraries and in the implementation of the execution system, that is, in what does not concern the application of the standard.

The following complexes are the most famous in the world.

Simatic Step 7(manufacturer - German company Siemens http://www.siemens.de/).

Software STEP 7 contains the central tool Simatic Manager, with which a wide range of functions can be implemented Siemens hardware programming .

All hardware and software requirements of the automation process in SIMATIC S7 are fulfilled within one project.

This project contains the necessary Hardware(+ configuration), network creation (+ configuration), all programs and data for solving the automation problem.

CoDeSys(manufacturer German company 3S Smart Software Solutionshttp://www.3s-software.com).

CoDeSys is one of the most developed functionally complete programming tools in the IEC 61131-3 standard.

TRACE MODE(manufacturer: AdAstra Research Group, Ltd, Russia).

TRACE MODE is an integrated Information system for industrial production management. The program contains tools for developing an operator interface (SCADA/HMI), programming controllers (Softlogic), managing fixed assets (EAM), personnel management (HRM) and production processes(MES).

the main task tools of the PLC programming complex consists of automating the developer’s work application system. He should be freed from routine work and constant “reinventing the wheel.”

Integrated PLC programming systems have developed a certain set of capabilities that allow them to be classified as rapid development tools. The integrated environment assumes the presence of built-in editors for text and graphic information.

Integration text editor into a unified programming environment involves:

· the ability to quickly enter standard text elements, instantly insert operators, functions, and functional blocks into the text;

· the ability to quickly automatically complete input. For example, the line: “INP1 I 3;Input 1” at the end of the input (CoDeSys) is converted in accordance with IEC requirements into the line:

INP1: INT:= 3; (* Input 1 *);

· automatic declaration of variables;

· presentation of the variable declarations section as text or a card index of tables, divided and sorted by functional meaning (input variables, local, etc.);

· syntax checking and automatic input formatting;

· automatic line numbering, which simplifies the description and maintenance of the program.

These features significantly help speed up the process of preparing programs and reduce the number of errors in programs.

Graphic editor integration provides the following features when design:

· automatic tracing of component connections (the programmer does not have to draw connections at all - the system automatically draws graphic connecting lines);

· automatic placement of components (this property is available graphic editor CoDeSys and OpenPCS);

· automatic numbering of circuits;

· copying and moving a selected graphic group of components, taking into account their individual specifics;

· arbitrary image scaling for the purpose of the best representation for the analysis of large branched graphic charts.

In mode execution built-in editors display “animated” texts and graphic diagrams. For graphical diagrams, the sequence of execution is clearly reflected.

Generally the software package must provide :

· Unified connection mechanism with PLC. The operation of debugging tools should not depend on how the controller is connected to the debugger. It does not matter whether the controller is emulated on the same computer, whether the controller is connected through the computer's serial port, or whether it is connected over the Internet.

· Code download control program into the controller memory.

· Automatic code version control (checking the compliance of the code contained in the PLC memory and the code obtained after the current compilation.

· Execution of the control program in real time.

· Stop mode. Stopping means stopping the execution of only the control program code. At the same time, all other phases of the operating cycle are executed and the ability to observe the values ​​of the inputs is preserved. In this mode, you can test and configure sensors and mechanisms of the controlled object;

· PLC reset. There may be several types of reset. The IEC standard provides two types of reset: “hot” and “cold”. The first involves resetting the control program to its initial state and performing the initial initialization of variables. The second type of reset adds an initial initialization of variables located in a non-volatile memory area. Additionally, the PLC can undergo a hardware reset by turning off the power or restarting the microprocessor. The programming system must respond adequately in the event of a hardware reset. The detailed response to reset commands is determined by the execution system. Therefore, there may be some differences between different PLCs, even in the same programming environment.

· Monitoring and changing instantaneous values ​​of all project variables, including PLC inputs and outputs. For ease of use, values ​​are presented in a user-specified number system.

· Fixation of variables, including inputs and outputs. Fixed variables will receive the specified values ​​​​in each operating cycle, regardless of the actual state of the PLC and the actions of the control program. This function allows you to simulate elementary external events in laboratory conditions and avoid unwanted operation of actuators when debugging on a “live” control object. Uncontrolled operation of mechanisms can lead to breakdown and pose a danger to surrounding people.

· Execution of the control program in steps of one work cycle. Used when checking the logical correctness of an algorithm.

· Step-by-step execution of program commands and setting breakpoints.

· View the sequence of component calls at a breakpoint.

· Graphical tracing of variables. The values ​​of the required variables are stored in a cyclic buffer and presented on the PC screen in the form of graphs. Values ​​can be recorded at the end of each work cycle or after specified periods of time. The trace is triggered manually or synchronized with a specified change in the value of a specific (trigger) variable.

· Visualization – animation pictures, composed of graphical primitives associated with program variables. The value of the variable can determine the coordinates, size, or color of the graphic object. Graphic objects include vector geometric figures or arbitrary raster images. The visualization may contain elements feedback, such as buttons, sliders, etc. Using visualization, an image is created that models the control object or operator control system.

PLCs have several basic programming languages. Firstly, it is something similar to high-level programming languages. It is called structured text language (in bourgeois ST). An extremely convenient thing if you have programming skills. Actually, it was invented for programmers. However, when the PLC was developed and implemented, the profession of a programmer (in the sense of an intelligent programmer with good technical training) was even more scarce than in our harsh times. Therefore, the practical Yankees and the whole world subsequently developed several types of graphic languages. A relay diagram language (LD in bourgeois) was created for electricians. Nothing complicated in general - an input bus, an output bus, between them - a circuit of relays, normally closed or open, and timers, of course, all sorts of triggers. The advantage is simplicity - if only there was a diagram, the program would be written. The downside is the difficulty of working with analog signals.

Another type of graphical language is the language of functional blocks (in bourgeois FBD). It reminds me very much of working, for example, with the Simulink package of the Matlab software package; for a friend opposite, it reminds me of Vissim. Yes, in general, it’s difficult to get a technical education without ever encountering this kind of software. The basis of everything is blocks connected in the required sequence by communication lines. If you are a techie, perhaps the easiest to learn and actively use. Plus – clarity, intuitive clarity of the implemented algorithms. Disadvantages: working with cycles. It’s possible, of course, but on ST this kind of program is written easier and shorter.
The latest version of the graphical language is algorithmic (SFC). This is the highest level graphic language. Each step is a small (or large) program. A very beautiful language, rightly adored by technologists of all stripes. Allows you to create tightly structured projects that are easy to debug. There is only one minus - you should take up studying it only after sufficiently mastering the ST, LD or FBD language. Programs for a separate step still need to be written on them.

Oh yes. I almost forgot. There is also something similar to assembler. It is called a list of instructions (in bourgeois IL). If you're a fan of endless battery life, this is for you. Disadvantages: long program code that looks good only in dissertation appendices, debugging problems. In short, in my understanding, it is the fifth wheel in the PLC programming cart. I might be wrong.

Program or project?

Let's immediately separate the cutlets from the flies. The code that we heroically write is, of course, a program. Or rather, more precisely, a program is a code that defines the PLC operating cycle. The controller may have not one, not two, but many. They can change due to time, external or program events. That is, the program is a rather private thing. The totality of what is “poured” into the controller is usually called a project. In addition to a set of programs, the project includes connected libraries, data types, visualizations, configurations, settings for a specific PLC, and much more.


Top