Priority Of The Operations; Precision Correction On Comparison Errors (Trunc) - Siemens SINUMERIK 840D sl Programming Manual

Nc programming
Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

Work preparation
3.1 Flexible NC programming
3.1.3.3

Priority of the operations

Each operator is assigned a priority. When an expression is evaluated, the operators with the
highest priority are always applied first. Where operators have the same priority, the evaluation
is from left to right.
In arithmetic expressions, the execution order of all the operators can be specified by
parentheses, in order to override the normal priority rules.
Order of operators
From the highest to lowest priority
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
Note
The concatenation operator ":" for Frames must not be used in the same expression as other
operators. A priority level is therefore not required for this operator.
Example: IF statement
If (otto==10) and (anna==20) gotof end
3.1.3.4

Precision correction on comparison errors (TRUNC)

The TRUNC command truncates the operand multiplied by a precision factor.
Settable precision for comparison commands
Program data of type REAL is displayed internally with 64 bits in IEEE format. This display
format can cause decimal numbers to be displayed imprecisely and lead to unexpected results
when compared with the ideally calculated values.
Relative equality
To prevent the imprecision caused by the display format from interfering with program flow, the
comparison commands do not check for absolute equality, but rather for relative equality.
444
NOT, B_NOT
*, /, DIV, MOD
+, –
B_AND
B_XOR
B_OR
AND
XOR
OR
<<
==, <>, >, <, >=, <=
Negation, bit-by-bit negation
Multiplication, division
Addition, subtraction
Bit-by-bit AND
Bit-by-bit exclusive OR
Bit-by-bit OR
AND
Exclusive OR
OR
Concatenation of strings, result type STRING
Comparison operators
Programming Manual, 12/2019, 6FC5398-2EP40-0BA0
NC programming

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840de sl

Table of Contents