IEC 61131-3: A Standard Programming Resource: Common Elements
IEC 61131-3: A Standard Programming Resource: Common Elements
IEC 61131-3 is the first real endeavor to standardize This means that their names can be reused in other parts
programming languages for industrial automation. With its without any conflict, eliminating another source of errors.
worldwide support, it is independent of any single If the variables should have global scope, they have to be
company. declared as such. Parameters can be assigned an initial
value at start up and cold restart, in order to have the right
IEC 61131-3 is the third part of the IEC 61131 family, and setting.
is a specification of the syntax and semantics of a unified
suite of programming languages, including the overall Configuration, Resources and Tasks
software model and a structuring language. To understand these better, let us look at the software
It consists of: model, as defined in the standard (see below).
Part 1: General Overview Configuration
Part 2 Equipment Requirements & Tests Resource Resource
Part 3 Programming Languages
Part 4 User Guidelines Task Task Task Task FB
Function
Part 5 Communications Block
Part 6 Functional Safety
Part 7 Fuzzy Control Programming Program Program Program Program
FB FB FB FB
Part 8 Application Guidelines
Part 9 Communication Interface Execution
control path
Functions Step 3
IEC has defined standard functions and user defined
functions. Standard functions are for instance ADD(ition),
ABS (absolute), SQRT, SINus and COSinus. User defined
functions, once defined, can be used over and over again. SFC describes graphically the sequential behavior of a
control program. With this it structures the internal
Function Blocks, FBs organization of a program, and helps to decompose a
Function Blocks are the equivalent to Integrated Circuits, control problem into manageable parts, while maintaining
ICs, representing a specialized control function. They the overview.
contain data as well as the algorithm, so they can keep SFC consists of Steps, linked with Action Blocks and
track of the past (which is one of the differences w.r.t. Transitions. Each step represents a particular state of the
Functions). They have a well-defined interface and hidden systems. A transition is associated with a condition, which,
internals, like an IC or black box. In this way they give a when true, causes the step before the transition to be
clear separation between different levels of programmers, deactivated, and the next step to be activated. Steps are
or maintenance people. linked to action blocks, performing a certain control
A temperature control loop, or PID, is an excellent action. Each element can be programmed in any of the IEC
example of a Function Block. Once defined, it can be used languages, including SFC itself.
over and over again, in the same program, different One can use alternative sequences and parallel sequences,
programs, or even different projects. This makes them such as commonly required in batch applications.
highly re-usable. Because of its general structure, SFC provides also a
Function Blocks can be written in any of the IEC communication tool, combining people of different
languages, and in most cases even in “C”. It this way they backgrounds, departments or countries.
can be defined by the user. Derived Function Blocks are
based on the standard defined FBs, but also completely Programming Languages
new, customized FBs are possible within the standard: it Within the standard four programming languages are
just provides the framework. defined. This means that their syntax and semantics have
been defined, leaving no room for dialects. Once you have
The interfaces of functions and function blocks are learned them, you can use a wide variety of systems based
described in the same way: on this standard. The languages consist of two textual and
FUNCTION_BLOCK Example two graphical versions:
Textual:
VAR_INPUT:
X : BOOL; Instruction List, IL
Y : BOOL; Structured Text, ST
END_VAR Graphical:
VAR_OUTPUT
Ladder Diagram, LD
Z : BOOL; Function Block Diagram, FBD
END_VAR
Programming Languages
Bottom Up