Siemens SINUMERIK 840D sl Programming Manual page 37

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

Advertisement

Parameters
TRUNC()
Relative equality considered 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 equality with (>) and (<) can be deactivated
by setting machine data MD 10280: 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.
Example: precision considerations
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
R11=TRUNC(R1*1000) R12=TRUNC(R2*1000)

R13=TRUNC(R3*1000)
IF ABS(R12-R11) > R13 GOTOF ERROR
M30
ERROR: SETAL(66000)
Job planning
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
Truncate decimal places
for
-12
;Assignment of initial values
;Jump was performed previously
;End of program
;Assignment of initial values
;Precision correction
;Jump is no longer executed
;End of program
Flexible NC programming
1.7 Comparison and logical operations
1-23

Advertisement

Table of Contents
loading

Table of Contents