Precision Correction On Comparison Errors (Trunc) - Siemens SINUMERIK 840D sl Programming Manual

Job planning
Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

1.5

Precision correction on comparison errors (TRUNC)

Function
The TRUNC command truncates the operand multiplied by a precision factor.
Settable precision for comparison commands
Program data of type REAL are 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 for relative equality.
Syntax
Precision correction on comparison errors
TRUNC (R1*1000)
Significance
TRUNC
Relative quality of 10
● Equality: (==)
● Inequality: (<>)
● Greater than or equal to: (>=)
● Less than or equal to: (<=)
● Greater/less than: (><) with absolute equality
● Greater than: (>)
● Less than: (<)
Compatibility
For compatibility reasons, the check for relative quality for (>) and (<) can be deactivated by
setting machine data MD10280 $MN_ PROG_FUNCTION_MASK Bit0 = 1.
Note
Comparisons with data of type REAL are subject to a certain imprecision for the above
reasons. If deviations are unacceptable, use INTEGER calculation by multiplying the
operands by a precision factor and then truncating with TRUNC.
Job Planning
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
:
Truncate decimal places
taken into account for
-12
1.5 Precision correction on comparison errors (TRUNC)
Flexible NC programming
73

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 828dSinumerik 840de sl

Table of Contents