61131-3
IEC:2003(E)
– 57 –
Table 23 - Standard functions of one numeric variable
Graphical form
Usage example
+---------+
* ---| ** |--- *
+---------+
(*) - Input/Output (I/O) type
(**) -
Function name
A := SIN(B) ;
(ST language - see 3.3)
No.
Function name
I/O type
Description
General functions
1
ABS
ANY_NUM
Absolute value
2
SQRT
ANY_REAL
Square root
Logarithmic functions
3
LN
ANY_REAL
Natural logarithm
4
LOG
ANY_REAL
Logarithm base 10
5
EXP
ANY_REAL
Natural exponential
Trigonometric functions
6
SIN
ANY_REAL
Sine of input
in radians
7
COS
ANY_REAL
Cosine in radians
8
TAN
ANY_REAL
Tangent in radians
9
ASIN
ANY_REAL
Principal arc sine
10
ACOS
ANY_REAL
Principal arc cosine
11
ATAN
ANY_REAL
Principal arc tangent
Copyright International Electrotechnical Commission
Provided by IHS under license with IEC
Not for Resale
No reproduction or networking permitted without license from IHS
--``````-`-`,,`,,`,`,,`---
– 58 –
61131-3
IEC:2003(E)
Table 24 - Standard arithmetic functions
Graphical form
Usage example
+-----+
ANY_NUM ---| *** |--- ANY_NUM
ANY_NUM ---| |
. ---| |
. ---| |
ANY_NUM ---| |
+-----+
(***) - Name or Symbol
A := ADD(B,C,D) ;
or
A := B+C+D ;
No.
d,e
Name
Symbol
Description
Extensible arithmetic functions
12
g
ADD
+
OUT := IN1 + IN2 + ... + INn
13
MUL
*
OUT := IN1 * IN2 * ... * INn
Non-extensible arithmetic functions
14
g
SUB
-
OUT := IN1 - IN2
15
c
DIV
/
OUT := IN1 / IN2
16
a
MOD
OUT := IN1 modulo IN2
17
b
EXPT
**
Exponentiation: OUT := IN1
IN2
18
f
MOVE
:=
OUT := IN
NOTE 1
Non-blank entries in the
Symbol column are suitable for use as operators in textual
languages, as shown in tables 52 and 55.
NOTE 2
The notations IN1, IN2, ..., INn refer to the inputs in top-to-bottom order; OUT
refers to the output.
NOTE 3
Usage examples and descriptions are given in the ST language defined in 3.3.
a
IN1 and IN2 shall be of generic type ANY_INT for this function. The
result of evaluating this
function shall be the equivalent of executing the following statements in the ST language as
defined in 3.3:
IF (IN2 = 0) THEN OUT:=0 ; ELSE OUT:=IN1 - (IN1/IN2)*IN2 ; END_IF
b
IN1 shall be of type ANY_REAL, and IN2 of type ANY_NUM for this function. The output shall be
of the same type as IN1.
c
The result of division of integers shall be an integer of the same type with truncation toward zero,
for instance, 7/3 = 2 and (-7)/3 = -2.
d
When the named representation
of a function is supported, this shall be indicated by the suffix “n”
in the compliance statement. For example, “12n” represents the notation “ADD”.
e
When the symbolic representation of a function is supported, this shall be indicated by the suffix
“s” in the compliance statement. For example, “12s” represents the notation “+”.
f
The MOVE function has exactly one input (IN) of type ANY and one output (OUT) of type ANY.
g
The generic type of the inputs and outputs of these functions is ANY_MAGNITUDE.
Copyright International Electrotechnical Commission
Provided by IHS under license with IEC
Not for Resale
No reproduction or networking permitted without license from IHS
--``````-`-`,,`,,`,`,,`---