Programming manual.
CNC 8070
1.
CREATING A PROGRAM.
Program structure.
·34·
(REF: 1709)
1.2.2 The subroutines.
A subroutine is a set of blocks that, once properly identified, may be called upon several times
from another subroutine or from the program. Subroutines are normally used for defining a
bunch of operations or movements that are repeated several times throughout the program.
See chapter "14 Subroutines.".
Types of subroutines.
The CNC has two types of subroutines, namely local and global. There is also a third type
available, OEM subroutines, that are a special case of a global subroutine defined by the
OEM.
Global subroutines.
The global subroutine is stored in CNC memory as an independent program. This subroutine
may be called upon from any program or subroutine being executed.
Local subroutines.
The local subroutine is defined as part of a program. This subroutine may only be called upon
from the program where it has been defined.
A program can have several local subroutines; but they all must be defined before the body
of the program. A local subroutine can call a second local subroutine with the condition that
the calling subroutine be defined after the one being called.
1
3
2
4
%L POINTS
G01 X·· Y·· (Point 2)
G01 X·· Y·· (Point 3)
G01 X·· Y·· (Point 4)
M17
%PROGRAM
G81 X·· Y·· (Point 1. Center punching definition)
LL POINTS (call to a subroutine)
G81 X·· Y·· (Point 1. Center punching definition)
LL POINTS (call to a subroutine)
G84 X·· Y·· (Point 1. Center punching definition)
LL POINTS (call to a subroutine)
G80
M30