M-Series Operator’s Manual 4/9/15
M99 - Return from Macro or Subprogram
M99 designates the end of a subprogram or macro and transfers control back to the calling program when executed.
M99 may be specified on a line with other G codes. M99 will be the last action executed on a line. If M99 is not
specified in a subprogram file, M99 is assumed at the end of the file:
Example:
G1 X3 M99 ;Move to X3 then return to calling program.
If M99 is encountered in the main job file, it will be interpreted as the end of the job. If M99 is encountered in an
M function macro file, it will be interpreted as the end of any enclosing subprogram or macro, or as the end of the
job.
M100 - Wait for PLC bit (Open, Off, Reset)
M101 - Wait for PLC bit (Closed, On, Set)
The M100/M101 commands wait for a PLC bit to reach a state as indicated in the table below.
Number PLC bit M100 M101
50001 – 51312 INP1 – INP1312 open closed
60001 – 61312 OUT1 – OUT1312 off on
70001 – 71024 MEM1 – MEM1024 reset set
90001 – 90064 T1 – T64 status bits reset (not expired) set (expired)
93001 – 93256 STG1 – STG256 status bits reset (disabled) set (enabled)
94001 – 94256 FSTG – FTSG256 status bits reset (disabled) set (enabled)
The number ranges 1-240 can be used to reference the first eighty INP, OUT, or MEM bits. It is recommended
that existing CNC10 programs and macros be converted to the new ranges for use with CNC11.
1 – 80 INP1 – INP80 open closed
81 – 160 OUT1 – OUT80 off on
161 – 240 MEM1 – MEM80 reset set
Example:
M101/50001 ; wait for INP1 to close
M100/60002 ; wait for OUT2 to turn off
M101/70123 ; wait for MEM123 to be set (1)
NOTE: The numbers assigned to the PLC bits (except 1-240) are the same as those that can be used when
referencing system variables in M- and G-code programs.