Positioning and control functions
Arithmetic
115
Unit
hardware
Connector
assignment / cable
Technical data
Configuration
Positioning and
control functions
Optimization
functions
Interfaces
Accessories /
options
Status
Parameter
Error list
N001: P013 = 2 * P013
(Multiplication)
N002: P010 = P040 + 1000.1234 (Addition)
N003: P005 = P005 / 2
(Division)
N004: P250 = P250 - 1
(Subtraction)
N005: V002 = V001 \ 1
(Whole number division)
N006: V3 = S15 % P12
(Modulo)
N007: POSR .V30
Only one operation or command is permitted per program line.
All calculations are executed in 48 bit format (real number); 24 bits before the
decimal point and 24 bits after the decimal point.
Such a real number can be represented with a maximum of 10 places, incl. prefix
and decimal point.
Up to 7 places can be recorded after the decimal point.
Ex. 1234567.89; -1.2345678
If a number overrun occurs while an arithmetic term is being calculated (because
the range of values is not sufficient or if divided by 0), COMPAX reacts as follows:
♦
collective error message E07 is activated.
♦
the program is stopped for safety reasons.
♦
the drive remains powered.
♦
any travel movements are interrupted using the stop ramp.
After Quit and Start, the same command would be processed again and probably
cause another error message.
For this reason, appropriate care should be taken when programming.
The causes of the error are stored in the optimization display (P233/P234=39) and
the last calculation error stored is always the first to be displayed.
Errors occur in the arithmetic due to the systematic errors which arise during the
display of figures in the control processor (the smallest number which can be
displayed is 2
-24
).
The calculation error can usually be ignored for addition, subtraction and
multiplication.
When dividing, significant discrepancies can result.
The "maximum relative input error" for the division y = x1 / x2 is calculated using
the following formula:
δ ∆
∆
≤
+
x
x
x
1
1
x
2
2
x
1
, x
2
≠
0
when
∆
x
1
=
∆
x
2
= 2
-24
or absolute:
∆
∆
∆
y
x
x
x
x
x
=
+
2
1
1
2
2
2
*
*
x
2
≠
0
when
∆
x
1
=
∆
x
2
= 2
-24
x1=12345.6; x2 = 0.0001
Result:
y = 123456000
max. relative error:
δ ≤
2-24
12345.6
+
2-24
0.0001
= 0.000596
max. absolute error:
73585.51
=
0.0001
2
*
12345.6
+
2
*
0.0001
=
y
2
-24
-24
∆
Arithmetic and
variable
examples:
Number format:
Dealing with
calculation errors:
Accuracy of
calculations:
Note!
Division y = x1 / x2
Example: