MachPro Advanced M-Code Reference
{{@2007#bkmrk--1}}
Chapter 1 : Advanced Macros
M-Code Descriptions
M19 - Spindle Orient
Command Spindle Orient with auto or manual cycle based on parameters
Parameters
S- Angle in degrees of the orientation
M5 or a stop spindle command will cancel the spindle orient
M34 - (Electronically) Gear Two Motors
Achieve electronic gearing between a master motor (Q) and a slave motor (S) at a given ratio (R).
"M34 Q2 S3" Will gear U axis to Z axis.
This M-code requires the "Motion filter" plugin be turned on in order to function
Parameters
Q- AxisID of the "master" motor
S- AxisID of the "slave" motor
R- ratio of <master>:<slave> scale
- a ratio of 1 will be the equivalent of slaving the two motors together in Mach 4
M35 - (Electronically) Ungear Two Motors
Remove the gearing between two (previously) geared motors.
The motors must have been previously geared together using M34.
Parameters
Q- AxisID of the "master" motor
S- AxisID of the "slave" motor
M38 - Turn On SSV (Spindle Speed Variation)
Vary the spindle speed to help with chatter issues while cutting
Parameters
P- RPM to very the speed by
E- Time interval that the speed is varied by
- Time interval that the speed is varied by
M38 is not available on all systems
M39 - Turn Off SSV (Spindle Speed Variation)
Turn off the spindle speed variation
M91 - Drill Bank 1
Drill bank 1 with Binary T Word for Drills
Parameters
TT Binary Call
M92 - Drill Bank 2
Drill bank 2 with Binary T Word for Drills
Parameters
TT Binary Call
M93 - Drill Bank 3
Drill bank 3 with Binary T Word for Drills
Parameters
TT Binary Call
M94 - Drill Bank 4
Drill bank 4 with Binary T Word for Drills
Parameters
TT Binary Call
M95 - Drill Bank 5
Drill bank 5 with Binary T Word for Drills
Parameters
TT Binary Call
M96 - Drill Bank 6
Drill bank 6 with Binary T Word for Drills
Parameters
TT Binary Call
M103 - Sub Spindle Forward
Turn on the Sub Spindle in the Forward direction
Parameters
SSpindle Speed (optional)
M104 - Sub Spindle Reverse
Turn on the Sub Spindle in the Reverse direction
Parameters
SSpindle Speed (optional)
M105 - Sub Spindle Stop
Turn off the Sub Spindle
M110 - Spindle Activate
Activate the spindle and send it down
Parameters
SSpindle Index
M111 - Spindle Deactivate
Deactivate the spindle and send it up
Parameters
SSpindle Index
M112 - Dust Cover Open
Open the dust cover
Parameters
SSpindle Index
M113 - Dust Cover Close
Close the dust cover
Parameters
SSpindle Index
M200 – M219: Control Default Outputs:
Turn outputs 0-9 on/off.
Parameters:
--none
Example:
M200 (Output 0 On)
M201 (Output 0 Off)
M202 (Output 1 On)
...
M219 (Output 19 Off)
M220 – Turn on Output:
General macro for turning on any outputs from parameters passed into the M-Code
This allows you to control any of the signals in Mach.
Write to a single output:
--A - Any Output Signal
--S - Output Signal Starting from Output#0
--D - Delay (Optional) ms
Examples:
M220 S2 D2000 (will turn on output signal #2 then wait 2000 ms)
M220 A2 (will turn on output signal #2 “X- lim”)
Parameters A or S must be used but not both at the same time.
Write to multiple outputs using output numbers:
--(Data:"1-10, 63") - Using a GCode Comment on the same line as the M-Code to turn on multiple outputs
--D - Delay (Optional) ms
Example:
M220 D1000 (This is a comment Data:"1-10, 63") turn on Outputs 1 through 10 and 63 and delay 1000ms
Write to multiple outputs using MachPro setting names:
--(Data:{"DriveEnable", "HardwareEnable"}) - Using a GCode Comment on the same line as the M-Code to turn on multiple outputs that are mapped to parameters
--D - Delay (Optional) ms
Example:
M220 D1000 (This is a comment Data:{"DriveEnable", "HardwareEnable"}) turn on the outputs that are mapped to parameters "DriveEnable" and "HardwareEnable" then delay 1000ms
The text entered after "Data:" should be a valid lua table using {} and "" and then remember to close the comment at the end of the line
M221 – Turn off Output:
General macro for turning off any outputs from parameters passed into the M-Code
This allows you to control any of the signals in Mach.
Write to a single output:
--A - Any Output Signal (This is typically not used and the "S" value is used instead. The "A" is based on the outputs listed in the configuration, starting at the beginning and counting all the way through.)
--S - Output Signal Starting from Output#0
--D - Delay (Optional) ms
Example:
M221 S2 D2000 (will turn off output signal #2 then wait 2000 ms)
M221 A2 (will turn off output signal #2 “X- lim”)
Parameters A or S must be used but not both at the same time.
Write to multiple outputs using output numbers:
--(Data:"1-10, 63") - Using a GCode Comment on the same line as the M-Code to turn off multiple outputs
--D - Delay (Optional) ms
Example:
M221 D1000 (This is a comment Data:"1-10, 63") turn off Outputs 1 through 10 and 63 and delay 1000ms
Write to multiple outputs using MachPro setting names:
--(Data:{"DriveEnable", "HardareEnable"}) - Using a GCode Comment on the same line as the M-Code to turn off multiple outputs that are mapped to parameters
--D - Delay (Optional) ms
Example:
M221 D1000 (This is a comment Data:{"DriveEnable", "HardareEnable"}) turn off the outputs that are mapped to parameters "DriveEnable" and "HardareEnable" then delay 1000ms
The text entered after "Data:" should be a valid lua table using {} and "" and then remember to close the comment at the end of the line
M222 – Wait for input:
This can be used to wait for clamps, doors closed or coolant up to pressure
Wait on Input using Signal numbers:
--A - Any Input Signal (This is typically not used and the "S" value is used instead. The "A" is based on the inputs listed in the configuration, starting at the beginning and counting all the way through.)
--C - Show Cycle Start dialog after timeout with message from signal description or GCode comment
--S - Input Signal Starting from Input#0
--T - Time-out (Optional) in seconds to create Alarm showing the signal description for GCode comment
--I - Invert Logic (Optional) (High Active = 0, Low Active = 1)
Example:
M222 S2 T5 (will wait up to 5 sec for Input#2 to go high.)
M222 A2 I1 (will wait indefinitely for Input Signal #2 to go low. Note, this is not Input#2, but the second input listed in the list of inputs.)
Wait on Input using MachPro setting names:
--(Data:{"DriveEnable"}) - Using a GCode Comment on the same line as the M-Code to wait on inputs that are mapped to parameters
--T - Time-out (Optional) seconds
--I - Invert Logic (Optional) (High Active = 0, Low Active = 1)
Example:
M222 T5 (Data:{"DriveEnable"}) - Will wait up to 5 sec for the signal that is mapped to "DriveEnable" to go high.
M222 I1 (Data:{"DriveEnable"}) - Will wait indefinitely for the signal that is mapped to "DriveEnable" to go low.
M223 – Pass Input to pound var:
This can be used along with macro B commands (macro B commands require industrial license to run) to set up logical switch cases or programed safety based on an input on the machine. i.e for running lights out you could have the first line of gcode check for a material verification input and do a M00 stop and wait for an operator if no material present.
Parameters:
--A - Any Input Signal
--S - Input Signal Starting from Input#0
--V - Mach Memory Address
--I - Invert Logic (Optional)
Example:
M223 S2 V500 (Will set #500 to the state of input#2)
IF [#500 EQ 1] GOTO 5 (check for material)
M00 (Stop)
N5
(Run Job)
M30
%
M224 – Pass Output to pound var:
Parameters:
--A - Any Input Signal
--S - Output Signal Starting from Output#0
--V - Mach Memory Address
--I - Invert Logic (Optional)
Example:
M223 S2 V500 (Will set #500 to the state of output signal #2)
M223 A2 V500 (Will set #500 to the inverse of the state of output #2 “x-“)
M225 – Call PLC Sequence:
By calling M225 in a gcode file you can start a block of user ladder logic in your PLC system. This is used for automation and custom setups
Parameters:
--D = Data to send
--V = Data index
--L = Debugging (logging) default 0
--S = Seq number
--M = Device number (modbus) default 0
Example:
M225 S5 (Start Seq 5 in PLC)
M225 S24 V0 D*PocketNumber (Rotate the tool carousel to pocket PocketNumber. USE WITH EXTREME CAUTION!)
M226 – Wait for PLC Sequence:
Used in conjunction with M225 this allows you to wait for the user ladder logic to signal completion.
Parameters:
--L = Debugging (logging) default 0
--S = Seq number
--M = Device number (modbus) default 0
Example:
M226 S5 (Waits for Seq 5 in PLC to finish)
M228 – GoTo Park Positions:
Easy setup to command the machine to user defined positions. This allows you to use the same code in all your files for tool setter position and then change that position once in one place when you need to move your tool setter.
Parameters:
--P - Position
Or
--(Data:"Name of GoTo Position") - GCode Comment formatted with GoTo position name
Example using "P" Parameter:
M228 P1 (GoTo Tool Change position)
P1 - Tool Change
P2 - Tool Setter
P3 - Part Zero
P4 - Machine Zero
P5 - Park Position
Example using GCode Comment:
M228 (Data:"Park 6")
M228 (Data:"Name of GoTo Position")
M230 – Map motor to axis:
--A - AxisID
--M - MotorID
Note: To map multiple motors, just run the macro multiple times with the new motor ID you want to map.
M231 – Un-Map motor from axis:
--A - AxisID
--M – MotorID
Note: "M-1" unmaps all motors on that axis.
M232 – Save, Delete, Restore motor mappings
--S1 Saves the current mapping config
--R1 Restore the last saved motor mapping
--D1 Delete current motor mapping.
M233 – Activate Dual Tables
--T1 Activate Table 1
--T2 Activate Table 2
--T3 Activate Table 3
M238 – Read user fields from the tool table:
General macro for reading the user fields in the tool table and writing them to pound variables
Parameters:
--V = Pound variable used for reading the value from the tool table
--(Data:"SpindleRotation") - Using a G-Code Comment on the same line as the M-Code to pass in the user field name from the tool table
Example:
M238 V550 (Data:"SpindleRotation") - Read user field "SpindleRotation" from tool table and write it to pound variable #550
M239 – Write to user fields in the tool table:
General macro for writing to the user fields in the tool table
Parameters:
--T = Value to be written to tool table
--(Data:"SpindleRotation") - Using a G-Code Comment on the same line as the M-Code to pass in the user field name from the tool table
Or
--I = Amount to add to the current value in the tool table
--(Data:"SpindleRotation") - Using a G-Code Comment on the same line as the M-Code to pass in the user field name from the tool table
Example:
M239 T1 (Data:"SpindleRotation") - Read current value in T parameter and write it to the user field "SpindleRotation"
M239 I1 (Data:"SpindleRotation") - Read current value in T parameter and add it to the current value in user field "SpindleRotation"
M240 – Create GMS Message with GCode Comment
Parameters
- P - Type of GMS Dialog 1 = Alarm, 2 = Notice, 3 = Notification
M242 – Read MachPro OEM setting:
General macro for reading MachPro OEM setting and writing them to pound variables
Parameters:
--V = Pound variable used for reading the value from the OEM Parameter
--(Data:"DriveEnableDelay") - Using a G-Code Comment on the same line as the M-Code to pass in the name of the OEM Parameter
Example:
M242 V550 (Data:"DriveEnableDelay") - Read the OEM Parameter and write it to pound variable #550
M243 – Write or Increment a Numeric Setting:
General macro for writing a numeric value to an existing machine setting or adds an amount to its current value.
These settings are stored under the Mach core/settings register device additionally they are also stored as "OEM Parameters”.
Set a value:
--M243 T<value> (Data:"<SettingName>")
Add to the current value:
--M243 I<amount> (Data:"<SettingName>")
| Parameter | Description |
|---|---|
T |
Replaces the setting’s current value. |
I |
Adds an amount to the setting’s current value. A negative amount subtracts from it. |
Data |
The name of the setting under core/settings. It must be supplied in a G-code comment on the same line. |
Either T or I is required, if both are provided, T takes precedence
Examples:
--Set DriveEnableDelay to 500:
M243 T500 (Data:"DriveEnableDelay")
-- Add 500 to SpindleRotation:
M243 T500 (Data:"DriveEnableDelay")
-- Disable Plasma THC
M243 T0 (Data:"HC_AutoHeightControlMode")
-- Enable Plasma THC
M243 T1 (Data:"HC_AutoHeightControlMode")
-- A pound variable or expression may also supply the value:
M243 T#100 (Data:"DriveEnableDelay")
M243 I[#101 * -1] (Data:"SpindleRotation")
M244 - Macro for starting a Reciprocating cycle on OB axis
Parameters
- Q - Axis ID (X = 0)
- A - Position A
- B - Position B
- D - Dwell on ends
- F - Feedrate (units per minute)
M245 - Macro for stopping a Reciprocating cycle on OB axis
Parameters
- Q - Axis ID (X = 0)
- S - S0 or no parameters means stop right away, S1 = Stop on A, S2 - Stop on B, S3 - Stop on A or B
M246 - Positioning OB Axis
General macro for Positioning Out of Band Axes with a Mcode. Has the option to command the axis to move and not wait for it to complete.
Parameters
- Q - Axis ID (X = 0)
- D - Position to move axis to
- E - (Optional) the default is wait for the move to complete. E1 will command and return right away without waiting for the move to finish.
- F - Feedrate (units per minute)
- W - Wait for the current move to complete. This will ignore the position passed to D. (W = 1)
M247 - Getting the position for the nearest rotation for a given angle
General macro for getting the nearest rotation in part coords or machine coords
Parameters
- Q - Axis ID (X = 0)
- A - Angle
- V - Pound Var to return the value to
- E - (Optional) E1 will return part coords E0 or nill will return Machine Coords
Example:
M247 Q(Axis) A(Angle) V(Returned Position) E1 (Part Coords) E0 or nill (Machine Coords)
M248 - Read Axis Torque and Write to Pound Var
General macro for reading Axis torque and write to pound var
Parameters
- A - Axis ID (X = 0)
- V - Pound Var used to write the status of GMS warnings to
M249 - Read GMS Warnings
General macro for reading GMS Warning and write state to pound variable
Parameters
-
- V - Pound Var used to write the status of GMS warnings to
M250 Probe Disable Wireless
M251 Probe Enable Wireless
M252 - General macro for checking to see if a signal or I/O is mapped to a parameter
M253 - Macro for Moving an OB Rotary Axis at a constant feedrate
Parameters
- Q - Axis ID (X = 0)
- F - Feedrate (units per minute)
- D - Direction (1 = CW, -1 = CCW)
M254 - Macro for Stopping an OB Rotary Axis at a constant feedrate
Parameters
- Q - Axis ID (X = 0)
M262 - Macro for Sending Label Data to AzureModule(Table Mode)
Send AzureModule label data in the form of lua tables in MCode
Optional: add ["templateId"] to set label template from mcode
--Examples
--M262 (Data: {["_Example1_"]="lorum ipsum","["_Example2_"]="Test2"})
M263 - Macro for Sending Label Data to AzureModule(File Mode)
Send AzureModule label data in the form of a file path to a lua table file and a label id
Optional: add ["templateId"] to set label template from mcode
--Examples
--M262 (Data: {["label_file"]="FULL_FILEPATH","["label_id"]=##})
M289 – Vacuum Zones On:
Router only. Turns vacuum hold-down zones on. First starts the vacuum pumps those zones are on (the Pump column in Mach Config > Vacuum) if they are off, and waits for each pump's feedback input (if it has one); a zone set to no pump starts none. Then waits until every zone it turned on has vacuum. Vacuum must be enabled (Mach Config > Vacuum > Enable vacuum).
Parameters:
--A1 - The Auto zones (set with the Auto button on a zone in the Vacuum widget, the Auto column in Mach Config, or M293 / M294)
--B1 - Dual Table: the zones on the active table, plus the shared zones. Does nothing when Dual Table is off or no zone is tied to a table
--Z1 - The zones listed in a GCode Comment on the same line: (Data:"1,3,5") or (Data:"1-4,7")
--E1 - The zones under the material (the sheet): each zone with at least Vacuum Material Zone Percent of its area under it. Where the material comes from is set on the Settings page under Vacuum > Material (see "Material zones (E1)" under M289)
--T - (Optional) Seconds to wait after switching on zones that have no vacuum check
A1, B1, Z1 and E1 can be combined; at least one is required.
Examples:
M289 A1 - Turn on the Auto zones and wait for vacuum
M289 B1 - Turn on the active table's zones and wait for vacuum
M289 Z1 (Data:"1,3,5") - Turn on zones 1, 3 and 5 and wait for vacuum
M289 E1 - Turn on the zones under the material and wait for vacuum
M289 Z1 T2.5 (Data:"6") - Turn on zone 6 (no vacuum check), then wait 2.5 seconds
Put the parameters after the M-Code: in "Z1 M289" the Z1 moves the Z axis. The zone list must be in quotes. Any error (an unknown zone, a zone on a pump that doesn't exist, a pump whose feedback doesn't come on within the Vacuum Wait Time, a zone that loses vacuum or is turned off while waiting, ...) raises an alarm and disables the machine.
Material zones (E1): Vacuum Material Source (Settings page, Vacuum > Material) sets where the material comes from:
--G-codeGCode Extent - The area the loaded file cuts: its feed moves, in machine coordinates (rapids are left out). An outside profile or a lead-in makes it a little bigger than the part; the percent allows for that
--Header - The sheet size in the G-code file's header comments, for example "( Material Size)" / "( X= 96.000, Y= 48.000, Z= 0.750)" from Vectric Aspire / VCarve, "[MATERIAL size: 48" x 48" x 0.5"]", "(STOCK/BLOCK, ...)", or "(Stock Size X100 Y50 Z20)". The sheet is placed with work zero at the corner set by Vacuum Material Header Origin, unless the header says where work zero is. Sizes without axis letters, such as "1220 x 2440", are not read
--HeaderHeader, Thenthen GCode Extent - The header when it has a sheet size, otherwise the G-codeGCode extentExtent
Vacuum Material Zone Percent is how much of a zone must be under the material (0 = any overlap). With Dual Table on, E1 only picks the active table's zones and the shared zones. If there is no material (Material Source is None, no file is loaded, the header has no sheet size, or the file has no cutting moves) E1 raises an alarm; it never turns on every zone. The G-codeGCode extentExtent is only updated when the tool path is regenerated, so after changing work zero, regenerate the tool path (or reload the file) before M289 E1. Setup, header formats and troubleshooting: Vacuum System.
M290 – Vacuum Zones Off:
Router only. Turns vacuum hold-down zones off. The vacuum pumps are left on.
Parameters:
--A1 - The Auto zones
--B1 - Dual Table: the zones on the active table, plus the shared zones
--Z1 - The zones listed in a GCode Comment on the same line: (Data:"1,3,5") or (Data:"1-4,7")
--E1 - The zones under the material (see M289)
--T - (Optional) Seconds to wait after switching the zones off (release time)
A1, B1, Z1 and E1 can be combined; at least one is required.
Examples:
M290 A1 - Turn off the Auto zones
M290 Z1 T1 (Data:"2-3") - Turn off zones 2 and 3, then wait 1 second
M290 E1 T1 - Turn off the zones under the material, then wait 1 second
M291 – Vacuum Pump On:
Router only. Turns vacuum pumps on, then waits for each pump's feedback input (if it has one) for up to the Vacuum Wait Time. Pumps are numbered as in Mach Config > Vacuum (Pumps).
Parameters:
--P - (Optional) Pump number
--(Data:"1,3") - (Optional) GCode Comment on the same line listing the pumps
P and the list can be combined. With neither, every pump that has an output is turned on. Naming a pump that doesn't exist, or one without an output, raises an alarm.
Examples:
M291 - Turn on every pump
M291 P1 - Turn on pump 1
M291 (Data:"1,3") - Turn on pumps 1 and 3
If the comment has "Data:" but no list that can be read (for example the list is not in quotes), the M-Code raises an alarm instead of turning on every pump.
M292 – Vacuum Pump Off:
Router only. Turns vacuum pumps off. Zones are left as they are, so zones that are still on and fed by a pump that is turned off will lose vacuum and the vacuum alarm action runs. Turn the zones off first with M290.
Parameters:
--P - (Optional) Pump number
--(Data:"1,3") - (Optional) GCode Comment on the same line listing the pumps
P and the list can be combined. With neither, every pump that has an output is turned off.
Examples:
M292 - Turn off every pump
M292 P1 - Turn off pump 1
M293 – Add Vacuum Auto Zones:
Router only. Adds zones to the Auto zones (the zones M289 A1 / M290 A1 switch). No zone is turned on or off. The change is saved, exactly like pressing Auto on a zone in the Vacuum widget, so it is still there after Mach restarts.
Parameters:
--(Data:"1,3,5") - GCode Comment on the same line listing the zones (required). Ranges work: (Data:"1-4,7")
--C1 - (Optional) Replace: the listed zones become the only Auto zones
Examples:
M293 (Data:"1,3") - Zones 1 and 3 become Auto zones as well
M293 C1 (Data:"1-4") - Zones 1 to 4 become the only Auto zones
M294 – Remove Vacuum Auto Zones:
Router only. Removes zones from the Auto zones. No zone is turned on or off. The change is saved.
Parameters:
--(Data:"1,3,5") - GCode Comment on the same line listing the zones (required). Ranges work: (Data:"1-4,7")
Examples:
M294 (Data:"2") - Zone 2 is no longer an Auto zone
M294 (Data:"1-12") - Zones 1 to 12 are no longer Auto zones
M295 – Vacuum Pods Up:
Router only. Raises the vacuum pods of the selected zones, then waits until every pod is up (its Up input is on, if it has one). A pod that isn't up within the Pod Wait Time raises an alarm. Pods must be enabled (Mach Config > Vacuum > Pods raise and lower), and every selected zone must have a pod (an Up output).
Parameters:
--A1 - The Auto zones
--B1 - Dual Table: the zones on the active table, plus the shared zones
--Z1 - The zones listed in a GCode Comment on the same line: (Data:"1,3,5") or (Data:"1-4,7")
--E1 - The zones under the material (see M289)
--V1 - (Optional) Once the pods are up, wait the Vacuum On Delay, then turn the zones' vacuum on and wait for vacuum, the same as M289 (the pumps are started if they are off)
--T - (Optional, with V1) Seconds to wait after switching on zones that have no vacuum check
A1, B1, Z1 and E1 can be combined; at least one is required. When "Vacuum on after raise" is turned on in Mach Config, M295 also waits until the zones' vacuum has been turned on, even without V1.
Examples:
M295 Z1 (Data:"1-12") - Raise the pods of zones 1 to 12 and wait until they are up
M295 A1 - Raise the Auto zones' pods
M295 V1 Z1 (Data:"1-12") - Raise the pods of zones 1 to 12, then turn their vacuum on and wait for vacuum
M295 V1 E1 - Raise the pods under the material, then turn their vacuum on and wait for vacuum
With Pod Sequence set to Interlocked (the default), M289 will not turn on a zone whose pod isn't up, and M289 never raises pods: raise them with M295 first.
M296 – Vacuum Pods Down:
Router only. Turns the selected zones' vacuum off, waits T seconds, lowers their pods, then waits until every pod is down (its Down input is on, if it has one). A pod that isn't down within the Pod Wait Time raises an alarm. The vacuum pumps are left on.
Parameters:
--A1 - The Auto zones
--B1 - Dual Table: the zones on the active table, plus the shared zones
--Z1 - The zones listed in a GCode Comment on the same line: (Data:"1,3,5") or (Data:"1-4,7")
--E1 - The zones under the material (see M289)
--T - (Optional) Seconds to wait after the vacuum goes off, before lowering the pods (release time)
A1, B1, Z1 and E1 can be combined; at least one is required.
Examples:
M296 Z1 (Data:"1-12") - Turn off the vacuum of zones 1 to 12, then lower their pods
M296 A1 T0.5 - Turn off the Auto zones' vacuum, wait 0.5 seconds, then lower their pods
M296 E1 - Turn off the vacuum under the material, then lower those pods
Typical use in a program:
M295 Z1 (Data:"1-12") (raise the pods)
M289 Z1 (Data:"1-12") (vacuum on)
...
M296 Z1 T1 (Data:"1-12") (vacuum off, 1 second release, lower the pods)
As with M289, put the parameters after the M-Code (in "Z1 M295" the Z1 moves the Z axis), and the zone list must be in quotes. Any error (pods not enabled, a zone without a pod, a pod that faults while waiting, ...) raises an alarm and disables the machine.
M900 - Auto Tool Setter Set Tool Length
--Examples
--M900 (Data: "1, 5")
--M900 (Data: "2-5")
--M900 (Data: "6")
M901 - Auto Calculate and Set Tool Setter Position
M902 - Auto Calculate and Set Z Fixture Offset
M903 - Change Auto Tool Setter name
M904 - Performs an action on a DataTracker
M920 - Control Profiling/Logging Behavior
This macro allows you to change the state (usually on/off) of an enabled profiling category.
Parameters
- L; the profiling context
- 0: Motion Controller (default)
- C: the profiling category to affect
- 0: Mach 4 core motion data (requires the MotionDataProfiler plugin)
- 100: motion data sent to the motion controller
- 101: motion loop performance data
- 102: motion controller verbose log
- 110-119: motion data sent to the drives
- 110: motor positions, velocities, statuses
- 111: motor positions, velocities, statuses, and other data for probing
- 112: motor positions, velocities, statuses, and other data for homing
- S: the new state for the profiling category
- 0: off
- 1: on
- 2: toggle (default)
- W: how/whether to wait for the state change to take effect
- 0: do not wait, issue the command to change state and return
- 1: wait until the state change is effective
- 2: do not issue the command, but wait until the specified state is effective
(This is usually done near the end of a run, whenM920 ... W0was executed earlier, and now you want to wait for it to complete.)
M1000 - Mandatory Program Stop Wait for Cycle Start
Parameters
- C - C1 will show the Standard Cycle Start dialog with the text from the GCode Comment
Pauses a program at any point, leaving the spindle running. Any comment provided on the same line will be shown to the customer. The control will not go into an Idle state with this mcode.
M1001 - Optional Program Stop
Pauses the program at any point the same as M1000, if the optional stop switch is turned on. Any comment on the same line will be shown to the customer. The control will not go into an Idle state with this mcode.
Custom M-Codes:
Every machine is a little different and has different functions and options. Custom M-Codes allow the user to create simple programming calls for complex processes, activating or deactivating outputs, reading inputs, performing math, or whatever else the user and machine could require. These M-Codes are programmed in Lua and placed in the macros folder under each profile. Every profile can have its own unique set of M-Codes. The file name must be the macro to be called.
{{@2016}}