Programming manual
CNC 8055
CNC 8055i
PROGR
A
M CONTR
O
L
INSTRUCTIONS
14.
·M· & ·EN· M
ODELS
S
OFT
: V02.2
X
·401·
Sub
routine
i
n
stru
ctio
ns
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
Summary of Contents for 8055 EN
Page 1: ...CNC 8055 M EN Programming manual Ref 1711 Soft V02 2x...
Page 8: ...8 Programming manual CNC 8055 CNC 8055i SOFT V02 2X...
Page 12: ...12 CNC 8055 CNC 8055i Declaration of conformity and Warranty conditions...
Page 16: ...16 CNC 8055 CNC 8055i Version history...
Page 22: ...22 CNC 8055 CNC 8055i Returning conditions...
Page 24: ...24 CNC 8055 CNC 8055i Additional notes...
Page 26: ...26 CNC 8055 CNC 8055i Fagor documentation...
Page 448: ......
Page 464: ...464 Programming manual CNC 8055 CNC 8055i D M EN MODELS SOFT V02 2X Key code...
Page 466: ...466 Programming manual CNC 8055 CNC 8055i D M EN MODELS SOFT V02 2X Key code MC operator panel...
Page 467: ...Programming manual CNC 8055 CNC 8055i D M EN MODELS SOFT V02 2X 467 Key code...
Page 468: ...468 Programming manual CNC 8055 CNC 8055i D M EN MODELS SOFT V02 2X Key code...
Page 471: ...Programming manual CNC 8055 CNC 8055i D M EN MODELS SOFT V02 2X 471 Key code 11 LCD Monitor...
Page 472: ...472 Programming manual CNC 8055 CNC 8055i D M EN MODELS SOFT V02 2X Key code...
Page 478: ...478 Programming manual CNC 8055 CNC 8055i F M EN MODELS SOFT V02 2X Maintenance...
Page 479: ...Programming manual CNC 8055 CNC 8055i F SOFT V02 2X 479...
Page 480: ...480 Programming manual CNC 8055 CNC 8055i F SOFT V02 2X...
Page 481: ......