The procedure for preparing and compiling programs for programmable controllers

Equipment control functions are determined by process technology and organization. Therefore, in general, they are quite specific and individual to each unit or site. However, when the problem of developing efficient, mobile and flexible software for automation systems is posed and solved, complex control functions are usually represented as a set of simple elementary actions such as "enable", "disable", "implementation delay" etc. .

From these positions, most of the control functions can be conditionally reduced to two, which are quite common for any tasks — logical and regulatory. The former is known as the general time action algorithm and the latter is known as the time parameter. The most general presentation of such typical functions for controlling technological equipment is shown in fig. 1, a and b.

Typical control functions of process equipment

Rice. 1. Typical control functions of process equipment

Based on the analysis of the quantitative characteristics of the implemented control functions in each specific example of technological equipment, technical requirements can be formulated to a programmable logic controller (PLC) as a means of control in terms of accuracy, speed, the number of parallel tasks to solve, the amount of memory, the composition of peripheral equipment, dialogue tools, etc.

The IEC 61131-3 standard describes 5 programming languages ​​resulting from the research of the most successful proprietary developments of the world leaders in the PLC market:

  • the language of relay-contact circuits (RKS) or ladder diagrams LD (ladder diagram),

  • function block diagram (FBD) language, FBD (function block diagram),

  • IL (instruction list) language — typical assembler with accumulator and label transitions,

  • ST (Structured Text) language is a high-level text language,

  • SFC (Sequential Function Chart) charts. SFC owes its origins to Petri nets.

PLC languages ​​are very original and differ significantly from well-known computer programming languages.

The standard does not oblige PLC developers to implement all programming languages. Typically, small PLC manufacturers implement multiple or a single language. In many ways, the priority of using a particular programming language depends on the historically established traditions of the industry or application area.

The standardization of programming languages ​​and the PLC model led to the emergence of specialized companies engaged in the design of programming systems for PLCs, which provide the transition from a programming language to a machine language at various levels:

  • when entering a program;

  • when rendering;

  • when changing or moving a separate command or program area;

  • when syntax errors are detected and signaling to the operator.

To perform these tasks, the programming system can successfully operate in local mode, that is, independently of the controller. This gives the programmer the opportunity to write a program from any convenient place, and not in a production workshop, that is, in an environment more favorable to the creative process. The possibility of modeling greatly facilitates the process of debugging the program and improves the organization of work.

Programmable logic controller - PLC

The main stages of preparation and programming for programmable controllers are as follows:

1. Determine what the controlled system (control object) should do, the control objectives and other additional functions performed by the control system, the sequence of operations performed by the actuators with respect to time and the state of the sensors and control devices.

2. Compose the algorithm of the program in graphic form.

3. Determine which modules are needed to connect sensors, control devices, actuators, alarms, and other equipment needed to manage the facility.

When choosing modules, analyze the parameters of the input / output signals (voltage and current levels) and the functionality of the modules. Pay attention to the possibility of use smart modules, which can perform pre-processing of input signals and some local control functions, which will greatly reduce the complexity of programming.

4.Make a diagram or table to connect all input and output devices of the control object and equipment used in the control process to the controller modules.

5. Write a program in one of the PLC programming languages ​​that performs a certain sequence of operations, their interconnection and develops possible emergency situations.

6. Check the program for syntax errors and correct them, and then for run-time errors and also make appropriate corrections.

7. Write the program and all necessary operating parameters to the controller.

8. After the control system is fully assembled, check the program in the actual control process and, if necessary, make more precise settings.

9. Save two copies of the last program and store them in separate locations.

We advise you to read:

Why is electric current dangerous?