Products
No reviews yet. Be the first to review!
Format for T-codes, M6, feedrate, speed, and coolant commands.
ptlchg$ #Tool change output ptoolcomment "G00 G91 G28 Z0.", e$ "M01", e$ *t$, "M06", e$ Use code with caution. Advanced Editing: Using Variables and Logic
Format statements ( fs or fs2 ) map how numbers display in the G-code file. They control decimal placement, trailing zeros, and coordinate resolution.
When you stop blaming the post and start commanding it, you aren’t just a CAM programmer anymore—you’re a machine whisperer.
This section initializes variables, sets mathematical constants, and defines formatting. For example, you define whether a variable outputs as an integer (no decimal) or a real number (with decimals). Formats and Formatting Assignments ( fmt ) mastercam post processor editing
Use # to comment on your changes so you know why you made them later.
Locate the .pst file corresponding to your machine. These are usually found in the C:\Users\Public\Documents\Shared Mastercam [Version]\mill\Posts directory. 2. Open the Post
Ensure your custom blocks start with a lowercase "p" (e.g., pcustom_block ) and are defined on a fresh line without indentation. Indentation Rules
Run the code in the machine controller's simulator before cutting metal. 6. Tips for Successful Post Editing Format for T-codes, M6, feedrate, speed, and coolant
Golden Rule: of your original .PST and .PSB before making any changes.
Contains the primary logic, formatting variables, and G-code generation rules.
Opening a .PST file can be intimidating. It looks like a mix of archaic BASIC programming and random CNC codes. However, a standard .PST is logically structured, typically composed of eight distinct sections:
To change how numbers look (e.g., forcing a decimal point or padding trailing zeros), modify the format assignments ( fmt ). For example, you define whether a variable outputs
Use comments ( # ) in your post file to explain why you made a change. This is critical for future troubleshooting.
# Example Variable Switches sub_prg_dir : 1 # Output subprograms to a separate directory? 0=No, 1=Yes progname$ : 1 # Force program number output at start? 0=No, 1=Yes rot_on_x : 1 # Axis of rotation is X? 0=No, 1=Yes Use code with caution.
To force a specific safety code layout and add operator setup notes at the beginning of the program, locate psof$ or pheader$ and inject your custom string outputs:
After a G28/Z0 move, the machine forgets its work offset.