-
M98 Sub-Program Calls
Overview
-
Calls into a G-Code program from another G-Code program
- Local variables
#1to#199are used as local variables
- These are saved to the local program’s current call that is in scope / on the call stack
- Global variables
#200to#99999are global and are the same for all programs
- Arguments can be optionally passed to a program
Command Format
-
Syntax
M98 "C:\Path\To\Folder\Program.nc"
or
M98 "Program.nc"
, which looks in the current directory for program.nc.
- Program location must be enclosed in
"
"
as shown above
-
M98 <arguments> "C:\Path\To\Folder\Program.nc"
-
<arguments> represents
-
Registers with values to be passed to sub program
-
e.g. Q123.4 U8 I9 Z42
- <arguments> can be accessed in the called program by using the @ symbol with the register letter following it.
-
- #1 = @Q ; #1 will be 123.4
- #7 = @U ; #7 will be 8
- #3 = @I ; #3 will be 9
- #10 = @Z; #10 will be 42
Examples
- M98 Q123.4 U8 I9 Z42 “C:\Path\To\Folder\Program.nc”
- M98 Q123.4 U8 I9 Z42 “Program.nc”
- M98 “Program.nc”
Details
¶
-
<arguments>
- Have to be assigned to a # variable (local or global)
- # variables are needed for use in macro expressions, the @(register) syntax is not allowed in macro expressions.
- e.g : X#1 is valid , X@Q is NOT valid
-
See Also:
¶