The parts of a Mastercam post
| Component | Role |
|---|---|
Post file (.pst) | MP language logic and output formatting |
| Machine definition | Axes, rotary configuration, limits, components |
| Control definition | Controller behaviour: arcs, tolerances, cycles, feed modes |
| Post text / strings | Messages, M-codes and custom strings |
Postblocks
MP code is organised in postblocks, called by the post engine at events such as start of file, tool change and each move.
pheader$ # Start of file
"%", e$
*progno$, e$
ptlchg$ # Tool change
pbld, n$, *t$, "M6", e$
pbld, n$, *sgcode, *sgabsinc, pwcs, *xout, *yout, *speed, *spindle, e$
plin$ # Linear move
pcan1, pbld, n$, sgplane, `sgcode, sgabsinc, pccdia,
pxout, pyout, pzout, feed, strcantext, e$
This excerpt is simplified to show structure; real posts use many more postblocks, variables and formats. The * forces output and e$ ends a line.
Formats
Format statements control decimals, leading and trailing zeros and prefixes for each address, which is essential for controllers with strict number formats.
Encrypted and reseller posts
Many Mastercam posts are supplied by resellers or machine dealers and may be encrypted. Modifying them may require permission or the unencrypted source. Where that isn't available, we develop a new post from a suitable generic base.
Development workflow
- Choose the closest generic post and machine/control definitions.
- Configure the machine definition to match kinematics and limits.
- Modify postblocks for header, tool change, cycles and M-codes.
- Post the test set; compare with proven programs.
- Simulate and prove on the machine.
A Mastercam post is three things working together: post, machine definition and control definition.
Mastercam post development
See our CNC post processor development service and Mastercam 3-axis posts.