Flexible NC programming
1.6 Variable minimum, maximum and range (MINVAL, MAXVAL and BOUND)
Job planning
70 Programming Manual, 07/2010, 6FC5398-2BP40-0BA0
1.6 Variable minimum, maximum and range (MINVAL, MAXVAL and
BOUND)
Function
The MINVAL and MAXVAL commands can be used to compare the values of two variables. The
smaller value (in the case of
MINVAL) or the larger value (in the case of MAXVAL) respectively is
delivered as a result.
The
BOUND command can be used to test whether the value of a test variable falls within a
defined range of values.
Syntax
<smaller value>=MINVAL(<variable1>,<variable2>)
<larger value>=MAXVAL(<variable1>,<variable2>)
<return value>=<BOUND>(<minimum>,<maximum>,<test variable>)
Significance
MINVAL: Obtains the smaller value of two variables (<variable1>,
<variable2>)
<smaller value>: Result variable for the MINVAL command
Set to the smaller variable value.
MAXVAL: Obtains the larger value of two variables (<variable1>,
<variable2>)
<larger value>: Result variable for the MAXVAL command
Set to the larger variable value.
BOUND: Tests whether a variable (<test variable) is within a defined
range of values.
<minimum>: Variable which defines the minimum value of the range of values.
<maximum>: Variable which defines the maximum value of the range of
values.
<return value>: 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.