EasyManua.ls Logo

Fagor 8070 BL - CHAPTER 14 SUBROUTINES

Fagor 8070 BL
444 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
CNC 8070
14
·265·
(REF: 1709)
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.
The CNC allows up to a total of seven subroutines to be executed per block (G180, G380,
G500, functions M with subroutine, etc.).
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. See "14.5 OEM subroutine execution." on page 278.
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.
Subroutine nesting levels and parameters.
Since a subroutine may be called upon from the main program (or a subroutine) and another
subroutine from this one and so on. The CNC limits the number of these calls to a maximum
of 20 nesting levels.
Arithmetic parameters in the subroutines
Local parameters.
The CNC has global parameters (accessible from the program or any subroutine) and local
parameters (accessible only from the program or subroutine where they have been
programmed).
Local parameters may be assigned to more than one subroutine up to 7 parameter nesting
levels within the 20 subroutine nesting levels. Not all the subroutine call types change the
nesting level; only the #PCALL, #MCALL calls and functions G180 to G189 and G380 to
G399.
Global parameters.
Global parameters will be shared by the program and the subroutines of the channel. They
may be used in any block of the program and of the subroutine regardless of the nesting level
they may be at.

Table of Contents

Related product manuals