Programming manual.
CNC 8070
14.
SUBROUTINES.
Definition of the subroutines
·268·
(REF: 1709)
14.2 Definition of the subroutines
Like the body of the program, a subroutine has a header, a body and an end-of-subroutine
function.
Header of a local subroutine.
The header of the subroutine is a block consisting of the "%L" characters followed by a blank
space and the name of the subroutine. The name of the subroutine may be up to 14
characters long and may consist of uppercase and lowercase characters as well as numbers
(no blank spaces are allowed).
The header must be programmed. The name of the header is used when calling a subroutine.
Header of a global subroutine.
The header of a global subroutine is the same as that of a program; in other words, it is a
block consisting of the "%" character followed by the name of the subroutine. The name may
be up to 14 characters long and may consist of uppercase and lowercase characters as well
as numbers (no blank spaces are allowed).
It is optional to program the header. The header name must not be used when calling a global
subroutine, use the name of the file as it is stored at the CNC, instead.
The name defined in the header has nothing to do with the name of the file. The two may
be different.
End of a global or local subroutine.
The end of the subroutine is defined with M17, M29 or the #RET instruction and they all are
equivalent. The #RETDSBLK instruction ends the subroutine and cancels the single block
treatment. One of them must be programmed to end the subroutine.
%L 0123456789
%L SUBROUTINE
%L SUB234S
%0123
%GLOBSUBROUTINE
%PART923R
M17
M29
#RET
#RETDSBLK