Leading Trailing Zeros CNC Programming Basics

Leading Trailing Zeros CNC Programming Basics

Category : Beginners Fanuc

Leading Trailing Zeros

You do not need leading or trailing zeros in a CNC program (see below):

O0001(G81 DEMO)
G21 G90 G40
T01 M06 (20.0 MM DIA X 90 POINT SPOT DRILL)
G90 G00 G54 X12.64 Y88.00 S2546 M03
G43 H01 Z15.00 M08
G0 Z100.00
Z1.00
G01 Z-0.1
Without leading Zero is exactly the same. (Trust me it won’t self destruct or start world war 3)
O1(G81 DEMO)
G21 G90 G40
T1 M6 (20.0 MM DIA X 90 POINT SPOT DRILL)
G90 G0 G54 X12.64 Y88. S2546 M3
G43 H1 Z15. M8
G0 Z100.
Z1.
G1 Z-.1

Try to keep your code consistent. As I mentioned before try to make all programs look the same.

Create an SOP (Standard Operating Procedure) which will cover all programming layout options. Haas controls will insert their own leading and trailing zeros so you won’t have a choice there.

Leading Trailing Zeros and Memory

Leading Trailing Zeros, if you are short of memory (not as in forgetful) this can save loads of space, and you might be surprised how small the memory is on some CNC machines, some have the memory of a fish.

Leading Trailing Zeros

CNC Programming

The main thing is that you are happy with the layout of your program.

If you are not consistent with your approach it can cause a lot of problems.

Please remember that when you are typing code into the machine it will take you considerably longer to type G01 X0.200 Y0.200 F100.00 than G1 X.2 Y.2. It could wear out your fingers or give you multi RSI.

A Haas control will automatically add leading zeros but just try to ignore it. Maybe Mr Haas likes to see them.

Main thing is you don’t need to type them in.

Take a look at this article.

Another way to save space on a Mazak control is to delete all the spaces (ISO G code programs only)

Contact David :07834 858 407

Services offered at CNC Training Centre

CNC Programming Course

Onsite CNC Machine Training.

Training on all controls and machines.

Mazak Training Fanuc Training

Don’t forget we offer training on all types of Mazak Machines and all Fanuc Controls 6m to 31i Oi old to young.


Log out of this account

Leave a Reply

Careers in CNC

View all current vacancies in CNC

Click here

Call David: 07834 858 407

WP to LinkedIn Auto Publish Powered By : XYZScripts.com