login
Products
IEC 61131 Basics
 

The IEC 61131 standard: basics and background

The IEC 61131 standard has been established to standardize the multiple languages, sets of instructions and different concepts existing in the field of automation systems. The great variety of PLC concepts has led to an incompatibility between the different PLC platforms and manufacturers in the past. The result was a great effort to be made for training, hard- and software investments.

IEC 61131 standardizes the programming languages, the interfaces between PLC and programming system, the different sets of instructions and the handling and structuring of projects. The advantage of using IEC 61131 conform PLCs and programming systems is a portability of all platforms and the use of same concepts reducing costs for automation systems.



   
 

What is the use of the IEC 61131-3 standard?

The main changes that have come with IEC 61131-3 are:

  • The IEC structure model defines the structure of the program code divided into clearly structured units, so called POUs (Program Organization Units). Each POU consists of a code part and a variables declaration part. POUs of the types program, function and function block (FB) are available. Function and FB POUs can be reused within the same project or when using libraries also in other projects.
  • Instead of direct addressing of inputs, outputs and flags, variables are used. Similar to higher programming languages, the variables in the project must be declared. Global and local data can be differentiated. Furthermore, there is a distinction between symbolic, directly represented and addressed variables. Retentive variables can be declared, whose values are retained even if the power supply is switched off or fails. Variables can be initialized with an initial value.
  • Declaration of data types is possible. Data types determine the format, size, possible value range and possible initial value of variables. The IEC defines a range of elementary data types (BOOL, BYTE, INT, WORD, DWORD, REAL, and many others). Furthermore, depending on the used control, user-defined data types like arrays and structures are possible.
  • Programming means symbolic programming.
  • IEC 61131-3 describes three graphical and two textual programming languages and defines their language elements as well as their syntax.
    A short description of each language can be found below.

 
 

 
 

IEC 61131 language: Ladder Diagram (LD)

The Ladder Diagram language (LD) has been used since the invention of PLCs for their programming. LD is ideally suited to programming sequential logic and for this reason is accepted worldwide and can be used universally. Development engineers as well as service engineers are capable to analyze the LD programming of a controller on site and diagnose and troubleshoot problems if required.

IEC 61131-3 defines a complete LD set of instructions, consisting of different types of contacts and coils. Contacts lead (according to their type) the power from the left to the right. Coils store the incoming value. Both, contacts and coils, are assigned to Boolean variables. An LD network can be supplemented by jumps, returns, labels and comments.

Furthermore, the IEC 61131 MULTIPROG programming system provides the opportunity to use FBD elements in LD networks, as shown in the following example.

  LD network with FBD function block in the graphical editor in MULTIPROG
 

 
 

IEC 61131 language: Function Block Diagram (FBD)

The language Function Block Diagram (FBD) defined in IEC 61131-3 consists of different functions and function blocks that are either linked or connected to variables. In FBD networks, jumps, labels and returns can be used. Apart from standalone use of FBD, LD elements can be connected to timers, counters and type converters etc. Programming is similar to the creation of functional diagrams or block diagrams, with the control logic being created by simply connecting blocks and elements.

FBD is frequently used in the process industry due to the flow-oriented properties of function blocks (reading FB inputs, processing, setting FB outputs).

  FBD code in the graphical editor in MULTIPROG
 

 
 

IEC 61131 language: Instruction List (IL)

The Instruction List language (IL) is a textual programming language and is similar to the assembler language. Code in IL consists of a sequence of instructions separated by lines, which consist of one operator ("command"), one operand (variable, constant or instance name) and one optional modifier respectively. Jumps and labels can be used.

In the IEC 61131 MULTIPROG programming system, the Edit Wizard is responsible for syntactically correct insertion of the language constructions. Furthermore, the text editor simplifies the programming work through syntax highlighting (color marking of language elements).

IL is mainly used if the processing speed of the PLC program has high priority.

IL code in the text editor in MULTIPROG
 
   
  ST code in the text editor in MULTIPROG

IEC 61131 language: Structured text (ST)

The textual Structured Text language (ST) is similar to the high-level language PASCAL or BASIC and is used for this reason by numerous programmers. ST uses statements like IF...THEN or FOR...NEXT.

In the IEC 61131 MULTIPROG programming system, the Edit Wizard is responsible for syntactically correct insertion of the language constructions. Furthermore, the text editor simplifies the programming work through syntax highlighting (color marking of language elements).

  The syntax and the set of instructions of ST are optimally suited for mathematical calculations and data manipulations. In combination with arrays and structures supported by MULTIPROG, the programmer thus has very flexible and powerful possibilities.
 
   
 

IEC 61131 language: Sequential Function Chart (SFC)

SFC is a status-oriented language. The code body programmed in the graphic language SFC consists of steps and transitions. A step contains the logic for a certain machine status, a transition represents a condition under which processing of the code is continued with the next step.

SFC is particularly suited to applications that can be structured into clearly identifiable steps. The logic contained in a step can be programmed in any other IEC programming language, adapted to the conditions of the respective machine status. This way, SFC becomes the first choice particularly for commissioning and the debug phase, as the structuring of the application into single steps significantly simplifies program diagnosis in case of errors - especially compared to a typical LD program with a large number of networks.

  SFC network in the graphical editor in MULTIPROG
 

 
 
[Print version] [Top]
Address
KW-Software GmbH
Langenbruch 6
32657 Lemgo (Germany)
+49 (0) 52 61 / 93 73-0
info@kw-software.com
Quick Links
Download Demo Software
Download Specification sheets
Download Brochures
Contact Person