M codes

Parent Previous Next

These are the default standard codes that are used in our normal virtual machines. Please note that customized machines may have other codes and formats.


M-code
(codes valid from V1.0.6.5)

Explanation

Format

Example

Machine type

M00

Optional stop (pause). Will pause the execution of the CNC program if the “Op.Stop” switch on the virtual CNC Controller is activated. Click start or play to continue.

M00

M00

All machines

M01

Unconditional stop (pause). The execution of the CNC program will pause. Click start or play to continue.

M01

M01

All machines

M02

Program end. Simulation will stop.

M02

M02

All machines

M03

Start of spindle clockwise. The rotation speed is controlled by the S code letter.

M03

M03 S2500

Milling and turning machines only

M04

Start of spindle counterclockwise. The rotation speed is controlled by the S code letter.

M04

M04 S2500

Milling and turning machines only

M05

Spindle stop.

M05

M05

Milling and turning machines only

M06

Execute a tool change. The number of the tool has to be preselected with the T code letter.

M06

T17 M06

Milling and turning machines only

M08

Turn on coolant.

M08

M08

Milling and turning machines only

M09

Turn off coolant.

M09

M09

Milling and turning machines only

M17

Return from subroutine or subprogram.

M17

M17

More info

All machines

M20

Open machine doors.

M20

M20

All machines with doors

M21

Close machine doors.

M21

M21

All machines with doors

M30

Program end. Simulation will stop.

M30

M30

All machines

M97 and M98

Call sub program. Use P for sub program number and L for the number of repetitions.

M98 P# L#

M98 P1000 L1

More info

All machines

M99

Return from a macro, subroutine or subprogram.

M99

M99

More info

All machines