Post Processors Are Where Your CAM Work Goes to Die (or Work)

You run a toolpath in Mastercam. It looks perfect on screen. You click post and send it to the machine. The machine does something completely different from what you expect. This happens because post processors are the unglamorous glue between your digital model and physical metal cutting. The Mastercam Mp Post Processor Reference Guide exists to explain how that glue works, but reading it cover to cover before you need it is like studying a cookbook before you've ever burned toast. I learned this the hard way on a Haas VF-2 that was supposed to do a contour pocket operation. The part program looked right in simulation. On the actual machine, the spindle would ramp into the material at full rapid feed rate instead of the programmed plunge rate. Took me forty-five minutes to realize the post was outputting G00 for the initial approach because a toggle variable called prapo was set incorrectly in the post configuration. The fix was editing a single line in the post processor file, changing the ramp output mode from zero to two. Without the reference guide, I would have spent another two hours staring at the screen wondering why Mastercam was lying to me.

Understanding the Mastercam Mp Post Processor Reference Guide

The reference guide is essentially a dictionary for Mastercam's post processor scripting language. It documents every built-in function, variable, and command that a post processor can use when generating G-code. A Mastercam post processor is a text-based script file, usually with a .mp extension, that translates Toolpaths into machine-specific code. Different machines need different outputs. A Fanuc-controlled mill speaks a slightly different dialect than a Mazak or a DMG MORI, even though they're all doing the same basic movements. The Mp in Mastercam Mp Post Processor Reference Guide refers to the post processor type used in older Mastercam versions. Modern installations typically work with post processor files directly through the post editor built into Mastercam. The reference guide covers syntax like pout for printing output, sdef for defining subroutines, and all the conditional logic variables that control whether a command outputs at all. Here is what most people skip over. The reference guide is not organized in a way that helps you when you are stuck. It is alphabetically ordered by function name. If you do not know the function name you need, you are flipping through pages of nothing. The practical approach is to open an existing post processor that is close to what you need and cross-reference its code against the guide. That is how you actually learn what is available.

How Post Processors Actually Work Under the Hood

When you post a toolpath, Mastercam reads the post processor line by line. The post processor checks each motion, each tool change, each coordinate adjustment, and decides what to output based on its internal logic. It is not a simple translation layer. It makes decisions. Conditional branches determine whether to output rapid moves, linear interpolations, or spindle commands. Some posts include macros that calculate feed rates based on tool diameter and material. Others hardcode everything. A post processor has several structural components. There is the header section that runs once at the beginning of the program. Then there are the motion blocks that execute for each individual toolpath segment. After that come the tool change routines and any subroutine definitions. Finally there is the trailer section that closes out the program. Understanding which part handles what lets you fix specific issues without breaking everything else. The variable system is where things get complicated. Mastercam uses a mix of pre-defined variables and custom ones. Variables like xout, yout, and zout output coordinate values. Variables like fout control feed rate output. But there are also obscure ones like cbldsp which controls whether canned cycle drilling parameters are displayed, and cspddta which manages spindle speed data output. The reference guide lists them, but it does not always explain when they matter in practice.

Get the Full Details

Version 9 MP Post Processor Online Reference Guide | PDF
Version 9 MP Post Processor Online Reference Guide | PDF

Common Problems and What the Reference Guide Does Not Tell You

The most frustrating issue I have encountered involves tool path chaining and how posts handle multiple operations in sequence. When you have consecutive operations that share the same tool and similar parameters, some post processors will suppress redundant tool changes and spindle commands. This is usually correct. But there is a specific edge case where the post processor decides to merge two operations that should remain separate because a variable tracking the previous operation state does not reset properly between operations with different work coordinates. I had a multi-operation program where the third operation was a separate face mill pass on a different Z plane. The post was silently merging it with the second operation because the tool number matched and the reference guide documentation on the opchk variable did not clearly explain that opchk only prevents tool changes, not motion block merging. The workaround was adding an explicit pout statement in the post to force a new block whenever the z-level changed more than a defined threshold. It took me about three hours to isolate because the reference guide never mentions opchk in combination with z-level monitoring. Another counter-intuitive behavior involves absolute versus incremental coordinate output. Most post processors default to absolute positioning (G90), but there are scenarios where switching to incremental (G91) for specific operations produces dramatically shorter and faster-executing programs. The reference guide documents the iout and oincr variables that control this, but it does not warn you that mixing G90 and G91 in the same program without proper cancel commands will confuse almost every CNC controller on the market. I learned this after a Siemens 840D machine threw an alarm on a program that had an uncancelled incremental block buried three thousand lines into the code.

The feed rate override behavior is another area where the reference guide falls short of practical guidance. Mastercam posts can output feed rate per minute (G94) or feed rate per revolution (G95). The transition between these modes depends on whether the post is processing a turning operation or a milling operation. The reference guide lists the variables but does not emphasize that some controllers interpret an unexpected G95 command as a catastrophic error rather than simply ignoring it. Always verify the controller's response to mode switches before running a posted program on production equipment.

Practical Workflow for Editing and Testing Posts

The safest workflow starts with copying the existing post processor file and renaming it. Never edit the stock post that comes with Mastercam. Your modifications will be lost the next time the software updates. Keep the original intact as a fallback. Use the Mastercam post editor for basic changes. It has syntax highlighting and basic error checking. For anything involving conditional logic or custom macros, switch to a plain text editor. Notepad works. Notepad++ is better because it shows line numbers and supports bracket matching, which matters when you are debugging nested if-then blocks. After every edit, run a simulation inside Mastercam before touching any physical machine. The simulation will catch obvious output errors like missing coordinates or incorrect G-code modes. But simulation does not catch everything. It will not tell you if your controller rejects a specific command sequence that the post is generating. For that, you need to run the posted program on an actual machine in dry run mode with the spindle off and the workpiece clear.

Mastercam MP Post Processor Guide | PDF
Mastercam MP Post Processor Guide | PDF

Here is a specific tip that saves hours. When testing a modified post, write a minimal test program with three or four basic operations instead of posting your entire production job. A single contour pocket, a simple drill cycle, and a tool change are enough to verify that the post is behaving correctly. If the test program looks right, the probability that the full program will work correctly increases significantly. Most post processor bugs manifest in the first hundred lines of output.

Limitations of the Reference Guide Approach

The reference guide assumes you already understand post processor architecture. It is not a tutorial. It does not explain why certain variables exist or how they interact with Mastercam's internal data structures. If you are starting from zero, you will finish reading it feeling like you have a dictionary but no language skills. The guide also does not cover every nuance of every Machine Control language. A Fanuc post and a Heidenhain post may both be documented in the same reference, but the practical differences between them are vast. The guide treats them as equally valid approaches when they are not interchangeable. Using a Fanuc-oriented post on a Heidenhain controller without significant modification will produce programs that either fail to execute or produce incorrect results. There is also the issue of version compatibility. The reference guide documents functions that may not exist in all versions of Mastercam. Some post processor features were added or deprecated between versions 2018, 2020, and 2022. If you are working with an older installation, certain variables and functions listed in the guide will simply not be recognized by your post processor compiler.

For users who need more hands-on guidance, community forums and vendor-specific documentation often provide better practical coverage than the reference guide alone. Haas, Mazak, and DMG MORI all publish their own post processor guidelines that address machine-specific quirks the Mastercam reference does not cover. Combining the reference guide with machine-builder documentation gives you a more complete picture than either source provides independently.

Mastercam MP Post Processor Guide | PDF
Mastercam MP Post Processor Guide | PDF