EasyManua.ls Logo

Fagor 8055 M - Subroutine Instructions

Fagor 8055 M
482 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...
Programming manual
CNC 8055
CNC 8055i
PROGRAM CONTROL INSTRUCTIONS
14.
·M· & ·EN· MODELS
SOFT: V02.2X
·401·
Subroutine instructions
14.5 Subroutine instructions
A subroutine is a part of a program which, being properly identified, can be called from any position
of a program to be executed.
A subroutine can be kept in the memory of the CNC as an independent part of a program and be
called one or several times, from different positions of a program or different programs.
Only subroutines stored in the CNC's RAM memory can be executed. Therefore, to execute a
subroutine stored in the hard disk (KeyCF) or in a PC connected through the serial line, copy it first
into the CNC's RAM memory.
If the subroutine is too large to be copied into RAM, it must be converted into a program and then
the EXEC instruction must be used.
(SUB integer)
The SUB instruction defines as subroutine the set of program blocks programmed next until reaching
the RET subroutine. The subroutine is identified with an integer which also defines the type of
subroutine; either general or OEM.
The OEM subroutines are treated like the general ones, but with the following restrictions:
They can only be defined in OEM programs, having the [O] attribute. Otherwise, the CNC will
display the corresponding error.
Error 63: Program subroutine number 1 thru 9999.
To execute an OEM subroutine using CALL, PCALL or MCALL, it must be inside an OEM
program. Otherwise, the CNC will display the corresponding error.
Error 1255: Subroutine restricted to an OEM program.
There can not be two subroutines with the same identification number in the CNC memory, even
when they belong to different programs.
( RET )
The mnemonic RET indicates that the subroutine which was defined by the mnemonic SUB, finishes
in this block.
Range of general subroutines SUB 0000 - SUB 9999
Range of OEM (manufacturer's) subroutines SUB 10000 - SUB 20000
(SUB 12)
G91 G01 XP0 F5000
YP1
X-P0
Y-P1
(RET)
; Definition of subroutine 12
; End of subroutine

Table of Contents

Related product manuals