User subroutines are useful when the necessary canned cycle is not available.
SUBROUTINES User subroutines are useful when the necessary canned cycle is not available. The user subroutine is an NC program which describes a sequence of operations which is often repeated when machining a particular part. If the same machining operation which was carried out already is to be performed at many different positions on the same workpiece, it can be executed by means of a program called subroutines. The subroutine can be used anywhere in the part program. If the machining operation is to be done at the same place repeatedly, the used program will be called repeat loop. If the subroutines are written in the same CNC program file as the calling mother program, it is called internal subroutines. If the subroutines are written in separate files as an external program and referred in the main program, it is called subprogram. The subroutine is called from the main NC program with a M97 or M98 command. Subroutines (within the same program) and subprograms (separate file on disk) can be called using M97 and M98 respectively using the same syntax. A subprogram can start with N. Repetitions can be given using the L word. Return from subprograms and subroutines can be done with M99. Programming structure in subroutine The basic syntax and use of the M97 subroutine are as follows:
Manufacturing Technology: Unit V: Programming of CNC Machine Tools : Tag: : Programming of CNC Machine Tools - Manufacturing Technology - subroutines
Manufacturing Technology
ME3493 4th semester Mechanical Dept | 2021 Regulation | 4th Semester Mechanical Dept 2021 Regulation