Siemens SINUMERIK 840D sl Programming Manual page 445

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

Advertisement

Syntax
Precision correction on comparison errors
TRUNC (R1*1000)
Meaning
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.
Synchronized actions
The response described for the comparison commands also applies to synchronized actions.
Examples
Example 1: Precision considerations
Program code
N40 R1=61.01 R2=61.02 R3=0.01
N41 IF ABS(R2-R1) > R3 GOTOF ERROR
N42 M30
N43 ERROR: SETAL(66000)
R1=61.01 R2=61.02 R3=0.01
NC programming
Programming Manual, 12/2019, 6FC5398-2EP40-0BA0
Truncate decimal places
taken into account for
-12
Work preparation
3.1 Flexible NC programming
Comments
;Assignment of initial values
; Jump would have been executed up
until now
; End of program
;Assignment of initial values
445

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840de sl

Table of Contents