M-Series Operator’s Manual 4/9/15
M123 - Record value and/or comment in data file
This M function will write the specified parameter value (if any) to the data file, followed by any comment that
appeared on the line with M123. If a P value is specified, M123 will record the numeric value (4 decimal places in
inches, 3 in millimeters). If neither a P value nor a comment was specified, M123 does nothing. This is not an
error. If no data file has been opened with M120 or M121 before M123 is called, then M123 will return an error
and terminate the job. The parameter L1 may be used to suppress the new line character normally outputted after
the last value. The R and Q parameters can be used to specify the field width and precision, respectively.
Furthermore, the output of axis labels, comma separators, and spaces can be enabled or suppressed via machine
parameter 72 (see Parameter 72 in Chapter 14).
Examples (M function and sample output):
M123 ;1.2345 ->1.2345
M123 P#A ; first macro argument ->1.2345 first macro argument
M123 Q0 P1.23 ->1
M124 - Record machine position(s) and optional comment in data file
Identical to M122 above except that the m124 reports machine position instead of a local WCS position.
M127 - Record Date and Time in a data file
This M function is used to write the date, time, and year to the specified data file called out by the M120 or M121.
Examples (M function and sample output):
M121 “testdata.dat”
M127
If you opened testdata.dat you would see: Day of week, Month, day, time, and year.
(i.e. Wed Aug 29 11:56:57 2007)
M128 – Move Axis by Encoder Counts
M128 moves the requested axis by L which specifies an encoder count position or quantity. The L parameter is
subject to the current G90/G91 mode (absolute/incremental).
Example:
G91 M128/X L-5000 ; move the X axis incrementally by -5000 counts
M129 - Record Current Job file path to data file
This M function is used to write the current job’s file path to the specified data file called out by the M120 or
M121.
Example:
Run a job named job.cnc which contains the following 2 lines:
M121 “output.txt”
M129
If you opened the output.txt file you would see:
c:\cncm\ncfiles\job.cnc