8 Basic CNC Programming
8.4 NC Codes
122
M98
Call to subprogram
Use the P code to specify the subprogram starting block number. Use the L code to
specify the number of times the subroutine is executed. You can nest subprogram calls
to a depth of 20.
See
9.7 Subprogram Programming, pg. 143.
M99
Return from Subprogram
Goto
See
8.4.12.2 M99 Code: Return from SubProgram, Goto, pg. 124, and
Programming, pg. 143.
M105
Operator Message
A nonstandard Intelitek code used to display messages.
See
8.4.12.3 M105 Code: Operator Message, pg. 124.
Homing Group
M111
Home the X axis.
M112
Home the Z axis.
8.4.12.1.
M22 Code: Output Current Position to File
The M22 code is used to write information to a file while a program is running. Typically, this code is
used when digitizing to write the current X and Z machine coordinates to a file. The proper format for
using this code is:
M22([filename.ext [,A]]) [text and macros]
Items in brackets [ ] are optional, except that a filename is required for the first M22 code used.
Info Table: Using the M22 Code
M22
([filename.ext [,A]]) [text and special codes]
Parameter
Notes
Filename
Must be enclosed in parentheses.
Must be specified the first time the M22 code is used in the program.
If not specified with subsequent M22 codes, the first specified file name will be used.
However, empty parentheses must still be used.
If the file does not exist, it will be created
A
If the file name is followed by
,A:
The new data is added to the end of the existing file; the existing data in the file is
not deleted.
The new data is automatically added on a new line in the file.
If the file name is not followed by
,A
, existing data in the file is deleted, and the new
data is added.