202 5 Standardised PLC Functionality
In the following sections, the calling interfaces (input and output variables and
the function [return] value) for standard functions and function blocks are
described in detail. Practical examples accompany the various descriptions.
The graphical declarations of all the standard functions and function blocks,
together with a short functional description, are given in Appendices A and B.
The general usage of functions and function blocks has already been discussed in
Chapter 2 and the properties of their formal parameters in Chapter 3.
5.1 Standard Functions
IEC 61131-3 defines the following eight groups of standard functions:
1) Data type conversion functions,
2) Numerical functions,
3) Arithmetic functions,
4) Bit-string functions (bit-shift and bitwise Boolean functions),
5) Selection and comparison functions,
6) Character string functions,
7) Functions for time data types,
8) Functions for enumerated data types.
Table 5.1 summarises all the standard functions of the standard. The special func-
tions for time data types (ADD, SUB, MUL, DIV, CONCAT) and neumerated
data types (SEL, MUX, EQ, NE) are grouped together with the other functions in
the categories Arithmetic, Comparison, Selection and Character string.
The table gives the function name, the data type of the function values and a
short description of the function. Together with Table 5.2, it also gives the names
and data types of the input variables.
With the exception of the generic data types, the abbreviations for the data types of
the input variables and function values in Table 5.1 are listed in Table 5.2. These
abbreviations correspond to the names of the input variables used by IEC 61131-3
for the respective standard functions.
ENUM
is an additional abbreviation used to
make Table 5.1 clearer.