Flexible NC programming
1.25 Subprogram technique
Job planning
Programming Manual, 07/2010, 6FC5398-2BP40-0BA0
191
1.25.3.6 Indirect subprogram call with specification of the calling program part
(CALL BLOCK ... TO ...)
Function
CALL and the keyword combination BLOCK ... TO is used to call a subprogram indirectly and
execute the program part designated by the start and end labels.
Syntax
CALL <program name> BLOCK <start label> TO <end label>
CALL BLOCK <start label> TO <end label>
Significance
CALL: Command for the indirect subprogram call.
Name of the subprogram (variable or constant) that contains
the program part to be executed (specification optional).
<program name>:
Type: STRING
Note:
If a
<program name> has not been programmed, the program
part designated by
<start label> and <end label> is searched
for in the current program and executed.
BLOCK ... TO ... : Keyword combination for indirect program part execution
Variable that refers to the start of the program part to be
executed.
<start label>:
Type: STRING
Variable that refers to the end of the program part to be
executed.
<end label>:
Type: STRING
Example
Main program:
Program code Comment
...
DEF STRING[20] STARTLABEL, ENDLABEL ; Variable definition for the
start and end labels.
STARTLABEL="LABEL_1"
ENDLABEL="LABEL_2"
...
CALL "CONTUR_1" BLOCK STARTLABEL TO ENDLABEL ; Indirect subprogram call and
identifier associated with
the calling program part.
...