Subroutines, Macros
2.9 Repeating program sections with indirect programming (CALL)
Job planning
2-22 Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
2.9 2.9 Repeating program sections with indirect programming (CALL)
Function
CALL is used to call up subroutines indirectly in which the program section repetitions
defined with BLOCK are run according to the start label and end label.
Programming
CALL <program_name> BLOCK <start_label> TO <end_label>
CALL BLOCK <start_label> TO <end_label>
Parameters
CALL Keyword for indirect subroutine call
<program_name> (option) Variable or constant of type string,
name of the program containing the
program section to run.
If no <program_name> is programmed,
the program section with
<start_label> <end_label> in the
current program is searched for and
run.
BLOCK ... TO ... Keyword for
indirect program section repetition
<start_label> <end_label> Variable or constant of type string
Refers to the beginning or end of
the program section to run
Example
DEF STRING[20] STARTLABEL, ENDLABEL
STARTLABEL = "LABEL_1"
ENDLABEL = "LABEL_2"
...
CALL "CONTOUR_1" BLOCK STARTLABEL TO ENDLABEL ...
M17
PROC CONTOUR_1 ...
LABEL_1 ; Beginning of program section
; repetition
N1000 G1 ...
LABEL_2 ; End of program section repetition