The ProtoTRAK, sold in many markets by XYZ Machine Tools and made by Southwestern Industries, is a control beloved in toolrooms because it is conversational: you program by answering prompts about the features you want, not by typing raw code. That convenience can make people think M-codes do not matter on a ProtoTRAK. They do. Underneath the friendly interface, the machine still turns the spindle on, changes tools, and runs coolant, and those functions are the same M-codes used across the industry. Knowing them helps you understand what the control is doing and prepares you for the G-code that newer ProtoTRAK models can read and edit.

This guide lists the common M-codes you encounter on a ProtoTRAK, explains what each does, and clears up how M-codes fit into a conversational control. The list is short and standard, which is good news whether you stay in conversational mode or move toward reading code.

A conversational control that still uses M-codes

In conversational programming you tell the ProtoTRAK what to do through events and settings, and it handles the underlying machine commands for you. When you set a spindle direction and speed, the control issues the equivalent of an M3 and an S value; when you set up a tool change, it handles the M6. So the M-codes are present even when you do not type them. On the newer ProtoTRAK models that include a G-code editor, you see the M-codes directly, which is where knowing them pays off. Either way, the M-codes control machine functions rather than motion, the same role they play on any control.

This is the key distinction worth holding onto: G-codes move the machine, M-codes switch things on and off. The difference between G-codes and M-codes is the same on a ProtoTRAK as anywhere else, even if the conversational layer hides it most of the time.

The common M-codes

Here are the M-codes you are most likely to encounter, in conversational settings or in G-code on the newer controls.

CodeMeaningNotes
M0Program stopHalts until the operator resumes
M1Optional stopStops only if the optional stop is on
M3 / M4Spindle on clockwise / counterclockwiseWith an S speed
M5Spindle stopEnds spindle rotation
M6Tool changeSelects or prompts the next tool
M8 / M9Coolant on / offWhere coolant is fitted
M30Program endEnds and resets the program

These are the same auxiliary functions you would find on a Fanuc or other industrial control, which is why learning them transfers directly if you move between machines. The CNCCookbook code reference lists the standard meanings, though a few auxiliary codes vary by machine builder, so confirm any uncommon ones against the ProtoTRAK documentation.

How M-codes appear in conversational programming

On a ProtoTRAK in conversational mode, you rarely type an M-code directly. Instead, the spindle direction and speed are part of the setup, the tool change is part of how you define each tool, and coolant is a setting. The control translates those choices into the right M-codes when it runs the program. This is genuinely convenient, but it can leave a gap in understanding, because an operator who only ever sets prompts may not realize what is happening underneath. Learning the M-codes fills that gap, so when the spindle does not start or coolant does not come on, you understand the function that failed rather than just the prompt.

M-codes on the G-code side

The newer ProtoTRAK controls can convert conversational programs to G-code and accept G-code programs, and that is where reading M-codes becomes a direct skill. In a G-code program you see the M-codes written out: an M3 with an S value to start the spindle, an M6 to change tools, an M8 for coolant, and an M30 at the end. Reading those lets you verify what a converted program will do, or understand a program brought in from elsewhere. The motion G-code and the M-codes together tell the full story of the program, and being able to read both is what lets you trust or correct it.

Reading a program block with M-codes

To see how the M-codes fit, picture the start and end of a G-code program. Near the top, after the setup, you see the spindle start: an M3 with the speed, then perhaps an M8 for coolant before the first cut. At the end you see the reverse: an M9 to shut off coolant, an M5 to stop the spindle, and an M30 to end the program. So the M-codes bracket the cutting work, setting the machine up at the start and standing it down at the end. Recognizing that bracket, the setup at the start and the stand-down at the end, is most of what reading the M-codes in a program involves, and it is the same pattern on any control you use.

The confusions worth clearing up

A few points trip people up. M0 and M1 both stop the program, but M0 always stops while M1 stops only when the optional stop switch is on, which is useful for checking a part during proveout without editing the program. M3 and M4 are easy to mix up; M3 is clockwise, the usual direction, and M4 is counterclockwise. And M2 and M30 both end a program, but M30 also resets it for the next run. None of these is hard, but a wrong assumption about a stop or a spindle direction can stall a job or, worse, run the spindle the wrong way, so it is worth getting them right.

Why the short M-code list is worth learning

The M-codes are a small, fixed set, which makes them ideal to learn completely. Unlike the long tail of G-codes, you can know every common M-code in an afternoon, and that knowledge does not change between a ProtoTRAK, a Fanuc, or a Haas for the core functions. So even if you program a ProtoTRAK conversationally most of the time, the M-codes are a high-value thing to have in memory, because they explain what the machine is doing and they carry over to every other control you might use. The same applies to the common M-codes a beginner should know, which are exactly these.

How conversational events map to M-codes

It helps to see how the conversational layer connects to the M-codes underneath. When you program an event on a ProtoTRAK, you fill in fields such as the tool number, the spindle speed and direction, and the feed. The control takes those fields and, at run time, issues the matching machine commands: the spindle direction field becomes an M3 or M4, the speed field becomes the S value, the tool field drives the M6, and a coolant setting becomes M8 or M9. So every conversational program is, in effect, generating M-codes you never typed. Seeing this mapping is what turns a ProtoTRAK from a box that just works into a machine you understand, and it makes the jump to reading actual G-code much smaller, because you already know what each function does.

When a machine function does not happen

Knowing the M-codes pays off most when something does not work. If the spindle does not start, the function that failed is the equivalent of M3, so you check the spindle settings and the machine side rather than guessing. If coolant does not come on, you are looking at the M8 function. If the program stops unexpectedly, an M0 or an M1 with the optional stop active may be the cause. Framing the problem in terms of the underlying M-code points you straight at the right setting or switch, which is faster than trial and error. An operator who only thinks in prompts has a vaguer picture of the machine, while one who knows the M-codes can name the failing function immediately and check the right thing first.

Moving from conversational to G-code

Many ProtoTRAK users start fully conversational and later want to read or use G-code, whether to bring in a program from CAM or to understand what a converted program does. That transition is much easier once the M-codes are familiar, because they are the part of the program that does not change between the conversational world and the G-code world. The motion side takes more learning, but the M-codes you already understand from setting prompts appear in the G-code exactly as you would expect. This is why learning the short M-code list early is a smart investment even for someone who has no immediate plan to leave conversational programming. The ProtoTRAK makes the start gentle, but the machine functions it manages are industry-standard, so the knowledge you build on it travels to whatever control you sit at next.

Building the recall that makes it automatic

Whether you meet the M-codes in conversational settings or in a G-code program, the value comes from recognizing them instantly. When M3, M6, M8, and M30 register without thought, you understand the machine’s actions and can verify a program quickly. That recognition is recall, and recall grows with short, repeated practice.

The free G-Code Sprint app at GCodePractice.com runs 60-second rounds on the common G and M codes and repeats whatever you miss, so the M-codes behind your ProtoTRAK programs become second nature. It is an educational practice tool for building that fluency, not a machine controller, so it complements working on the ProtoTRAK rather than replacing it. Learn the short M-code list, understand what each function does, and the conversational control stops feeling like a mystery underneath the prompts.

Frequently asked questions

What are the common M-codes on a ProtoTRAK?

The common ones are M0 and M1 for program stops, M3 and M4 for spindle on clockwise and counterclockwise, M5 to stop the spindle, M6 for tool change, M8 and M9 for coolant, and M30 to end the program. They are the same standard auxiliary functions used across the industry. To learn them by heart, the free G-Code Sprint app at GCodePractice.com drills the common G and M codes in 60-second recall rounds.

Does the ProtoTRAK use G-code and M-codes?

Yes. The ProtoTRAK is mainly conversational, so it handles the M-codes for you when you set prompts, but underneath it uses the standard M-codes for machine functions. Newer models can convert to and read G-code, where the M-codes appear written out and you can read them directly.

What is the difference between M0 and M1 on a ProtoTRAK?

M0 is a program stop that always halts the program until the operator resumes, while M1 is an optional stop that only halts when the optional stop switch is on. M1 is handy for checking a part during proveout without changing the program.

Are ProtoTRAK M-codes the same as on other machines?

For the core functions, yes. M3, M5, M6, M8, and M30 mean the same on a ProtoTRAK as on a Fanuc or Haas, which is why learning them transfers between machines. A few rarer auxiliary codes can vary by builder, so confirm those against the ProtoTRAK documentation.

Do I need to know M-codes if I program conversationally?

It is not strictly required, since the control handles them, but it is very worthwhile. Knowing the M-codes lets you understand what the machine is doing, troubleshoot when a function fails, and read the G-code the newer models produce. The set is small enough to learn completely.

What does M30 do on a ProtoTRAK?

M30 ends the program and resets it so the next run starts cleanly. It is the usual end-of-program code, similar to M2 but with the reset, and it appears at the end of a G-code program on the controls that read code.