CNC:Subprogram

A CNC program is a series of instructions, assigned to different tools and operations. If such a program includes two or more repetitive instructions, its structure should be changed from a single long program to two or more separate programs. Each repetitive instruction is written only once and called when required. This is the main concept of subprograms. Figure below shows a typical part layout repeated at different locations.

Subprogram benefits

⇒Repetitive machining motions
⇒Functions relating to tool change
⇒Hole patterns
⇒Grooves and threads
⇒Machine warm-up routines
⇒Pallet changing
⇒Special functions

The subprogram call function M98 must always be followed by the subprogram number P--. The subprogram end function M99 terminates the subprogram and transfers the processing back to program it originated from (a main pro-gram or a subprogram). Although M99 is mostly used to end a subprogram, it may also be rarely used in the main program, replacing the M30 function.The address P identifies the selected subprogram number.

When the main program and the subprogram coexist in the control, they must differ by their program numbers. During processing, they will be treated as one continuous program, so a distinction must be made for the program end function as well. The end of program function is M30 or, less frequently, MO2. The subprogram must be terminated by a different function. Fanuc uses M99 for that purpose

When a subprogram terminates, the control returns the processing to the program of origin it will not terminate the main program that is the exclusive function of M30.the subprogram end M99 returns the processing to the block immediately following the subprogram call M98. 

 

 

Category: 

tags: 

Share

Who's new

  • ravirajpatil871...
  • shubhambajoria
  • yassir
  • demiholyman890954
  • scottgillum51169040

Get Notified

 

Share

We are Social

Syndicate

Subscribe to Syndicate