Siemens SINUMERIK 840D sl Programming Manual page 76

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

Advertisement

Flexible NC programming
1.6 Variable minimum, maximum and range (MINVAL, MAXVAL and BOUND)
<return value>:
Note
MINVAL, MAXVAL, and BOUND can also be programmed in synchronized actions.
Note
Behavior if values are equal
If the values are equal MINVAL/MAXVAL are set to this equal value. In the case of BOUND the
value of the variable to be tested is returned again.
Example
Program code
DEF REAL rVar1=10.5, rVar2=33.7, rVar3, rVar4, rVar5, rValMin, rValMax, rRetVar
rValMin=MINVAL(rVar1,rVar2)
rValMax=MAXVAL(rVar1,rVar2)
rVar3=19.7
rRetVar=BOUND(rVar1,rVar2,rVar3)
rVar3=1.8
rRetVar=BOUND(rVar1,rVar2,rVar3)
rVar3=45.2
rRetVar=BOUND(rVar1,rVar2,rVar3)
76
Result variable for the BOUND command
If the value of the test variable is within the defined range of
values, the result variable is set to the value of the test variable.
If the value of the test variable is greater than the maximum
value, the result variable is set to the maximum value of the
definition range.
If the value of the test variable is less than the minimum value,
the result variable is set to the minimum value of the definition
range.
Comments
; rValMin is set to value 10.5.
; rValMax is set to value 33.7.
; rVar3 is within the limits, rRetVar is set to 19.7.
; rVar3 is below the minimum limit, rRetVar is set to
10.5.
; rVar3 is above the maximum limit, rRetVar is set to
33.7.
Programming Manual, 06/2009, 6FC5398-2BP20-0BA0
Job Planning

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 828dSinumerik 840de sl

Table of Contents