Subprogram
Subprograms used in the system pause the selected program at the current line and redirect to the first line of the relevant subprogram. It then returns to the line where the main program left off by encountering the M99 command inside the subprogram and continues from there. A group of operations that need to be repeated multiple times can be consolidated into a subprogram, such as tool change subprogram, table change subprogram, or tool offset subprogram.
The file names of subprograms should be in the Oxxxx.cnc format, where "xxxx" represents a numerical value. For example, the file O9001.cnc defines subprogram number 9001.
Correct examples of subprogram file names:
O0001.cnc
O1234.cnc
O9001.cnc
O9009.cnc
Incorrect examples of subprogram file names:
0001.cnc
4.cnc
SUB1.cnc
ABC.cnc
The last line of a subprogram should contain the M99 command. A maximum of two nested subprogram calls can be made in the system. Macro commands can be used within subprograms. Other commands on the lines redirected to the subprogram will not be processed and will be directed to the subprogram.
