ADTECH9 Series CNC Programming Manual
1.3.2
Main program and subroutine
The processing programs include main programs and subroutines. Generally, NC executes the instructions of
main program; however, NC will turn to execute subroutine when executes a subroutine calling instruction,
and will return to the main program when executes the return instruction in subroutine.
When the processing program needs to run same track for several times, edit this track into the subroutine and
save in the program memory of the machine tool, and this subroutine can be called when this track should be
executed in the program.
When the main program calls a subroutine, this subroutine can call another subroutine, which is called double
nesting. Generally, the machine tool allows up to quadruple subroutine nesting. In calling subroutine
instruction, the subroutine can be repeated for 999 times.
Fig. 1.3.2 Main Program and Subroutine
Subroutine format:
OXXXX ; Subroutine name
………… ;
………… ; Subroutine content
………… ;
M99 ; Subroutine ends, and returns to previous program
Example: X100.0 Y100.0 M99;
Note:
Summary of Contents for CNC9640
Page 1: ...ADTECH9 Series CNC Programming Manual ...
Page 21: ...ADTECH9 Series CNC Programming Manual Workpiece Coordinate System Diagram ...
Page 44: ...ADTECH9 Series CNC Programming Manual 2 Occasions that inner corner rotates ...
Page 45: ...ADTECH9 Series CNC Programming Manual ...
Page 62: ...ADTECH9 Series CNC Programming Manual Manual insertion ...
Page 65: ...ADTECH9 Series CNC Programming Manual Tool radius compensation start and axis Z cut in action ...
Page 117: ...ADTECH9 Series CNC Programming Manual ...
Page 118: ...ADTECH9 Series CNC Programming Manual ...
Page 142: ...ADTECH9 Series CNC Programming Manual ...
Page 143: ...ADTECH9 Series CNC Programming Manual ...