Download Fagor
Transcript
14.5 SUBROUTINE STATEMENTS 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 Memkey Card, HD or in a PC connected through the serial lines, it must be copied 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 as described in section 14.6 (SUB integer) The mnemonic SUB defines the set of program blocks which are programmed after this block as a subroutine by identifying this subroutine with an integer, between 0 and 9999, which is specified after it: 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. Example: (SUB 12) G91 G01 XP0 F5000 YP1 X-P0 Y-P1 (RET) ; Definition of subroutine 12 ; End of subroutine (CALL (expression)) The mnemonic CALL makes a call to the subroutine indicated by means of a number or by means of any expression which results in a number. As a subroutine may be called from a main program, or a subroutine, from this subroutine to a second one, from the second to a third, etc..., the CNC limits these calls to a maximum of 15 nesting levels, it being possible to repeat each of the levels 9999 times. Page 6 Chapter: 14 PROGRAM CONTROL STATEMENTS Section: SUBRUTINESTATEMENTS
Related documents
fagor documentation for the 8055 cnc
CNC 8055 T
The user manual describes all items concerning the
CNC 8025 T, TS - Fagor Automation
3. - Fagor Automation
CNC 8035 - Manual de Operação
PROJECT
Hafler TRM6.1 User's Manual
ECHK90 & ECPK90 Extractors
TEK VX4240 User
4. - Fagor Automation
DYNAMIC ORDERED INHERITANCE AND