Flexible NC programming
1.25 Subprogram technique
Job planning
Programming Manual, 07/2010, 6FC5398-2BP40-0BA0
183
Example 2: Calling a main program as a subprogram
10
1
1:(//(
103)
$GGLWLRQDOPDLQ
SURJUDP
RU
0DLQSURJUDP
1.25.3.2 Subprogram call with parameter transfer (EXTERN)
Function
For a subprogram call with parameter transfer, variables or values can be transferred directly
(but not
VAR parameters).
Subprograms with parameter transfer must be declared with
EXTERNAL in the main program
before they are called in the main program (e.g., at the beginning of the program). The name
of the subprogram and the variable types are thereby specified in the sequence in which
they are transferred.
CAUTION
Both the variable types and the sequence of the transfer must match the definitions
declared under
PROC in the subprogram. The parameter names can be different in the main
program and the subprogram.