Flexible NC programming
1.25 Subprogram technique
Job planning
190 Programming Manual, 07/2010, 6FC5398-2BP40-0BA0
1.25.3.5 Indirect subprogram call (CALL)
Function
Depending on the prevailing conditions at a particular point in the program, different
subprograms can be called. The name of the subprogram is stored in a variable of type
STRING. The subprogram call is realized with
CALL and the variable name.
CAUTION
The indirect subprogram call is only possible for subprograms without parameter transfer.
For a direct subprogram call, save the name in a STRING constant.
Syntax
CALL <program name>
Significance
CALL: Command for the indirect subprogram call.
<program name>: Name of the subprogram (variable or constant)
Type: STRING
Example
Direct call with STRING constant:
Program code Comment
…
CALL "/_N_WKS_DIR/_N_SUBPROG_WPD/_N_PART1_SPF" ; Direct call to subprogram
PART1 with CALL.
…
Indirect call via variable:
Program code Comment
…
DEF STRING[100] PROGNAME ; Define variable.
PROGNAME="/_N_WKS_DIR/_N_SUBPROG_WPD/_N_PART1_SPF" ; Assign subprogram PART1 to
the PROGNAME variable.
CALL PROGNAME ; Indirect call to sub-
program PART1 via CALL and
the PROGNAME variable.
…