16 subprograms, 16 subpr ogr ams – HEIDENHAIN CNC Pilot 4290 User Manual
Page 194

4 DIN PLUS
182
4.16 Subprograms
Calling a subprogram:
L”xx” V1
■
L: Indicator of subprogram call
■
”xx”: Name of the subprogram – file name for
external subprograms (max. 8 characters or letters)
■
V1: Identification code for external subprograms –
omitted for local subprograms
Note on using subprograms:
■
External subprograms are defined in a separate file.
They can be called from any main program, other
subprograms, or from TURN PLUS.
■
Local subprograms are in the main program file.
They can be called only from the main program.
■
Subprograms can be ”nested” up to 6 times.
Nesting means that another subprogram is called
from within a subprogram.
■
Recursion should be avoided.
■
You can add up to 20 ”transfer values” to a
subprogram.The designations (parameter
designations) are:
LA..LF, LH, I, J, K, O, P, R, S, U, W, X, Y, Z.
The transfer values are available as variables within
the subprogram. The identification code is: ”#__..”,
followed by the parameter designation in lowercase
letters (for example: #__la).
You can use the transfer values when programming
with variables within the subprogram.
■
The variables #256..#285 are available in every
subprogram as local variables.
■
If a subprogram is to be executed repeatedly,
define in the ”number repeats Q” parameter the
number of times the subprogram is to be repeated.
■
A subprogram ends with RETURN.
Dialog texts
You can define the parameter descriptions that
precede/follow the input fields in an external
subprogram.
The CNC PILOT automatically sets the unit of
measure for parameter values to the metric system
or inches.
Max. 19 descriptions – the parameter descriptions
can be positioned within the subprogram as desired.
4.16 Subpr
ogr
ams
The parameter ”LN” is reserved for the transfer of block
numbers. This parameter may receive a new value when
the NC program is renumbered.
Parameter descriptions:
[//] – Beginning
[pn=n; s=parameter text (max. 16 characters) ]
[//] – End
pn:
Parameter designations (la, lb, ...)
n:
Conversion number for units of measurement
■
0: Non-dimensional
■
1: ”mm”
or
”inch”
■
2: ”mm/rev”
or
”inch/rev”
■
3: ”mm/min”
or
”inch/min”
■
4: ”m/min”
or
”feet/min”
■
5: ”Rev/min”
■
6: Degrees (°)
■
7: ”µm”
or
”µinch”
Example
. . .
[//]
[la=1; s=bar diameter]
[lb=1; s=starting point in Z]
[lc=1; s=chamfer/round. (-/+)]
. . .
[//]
. . .