Order of CNC Code

Order of CNC Code

Category : Beginners

Orders

CNC Programming Basics:

Running Order

Call 0333 939 8388

The order of your code in one block does not matter from the computer’s point of view (see below). The computer gobbles up a line or block of code and then makes sense of it.

If you programme G90 G0 X50. Y50. Z50. all the axis will move together so G90 G0 Z50. Y50. X50. would be exactly the same. I just jumbled it up, not to confuse you, just to show you that it does not matter.

O0001 (G81 DEMO)
(PROGRAMMER PETER ANDRE)
G21 G90 G40
(G90 G40 G21) Works the same

T01 M06 (20.0 MM DIA X 90 POINT SPOT DRILL)
(M06 T01) Works the same

G90 G0 G54 X12.64 Y88.0 S2546 M3
(S2546 M3 G90 G0 G54 X12.64 Y88.0) Works the same

However it is best to keep the order the same. Create your own convention and stick to it.
G90 G0 G54 X12.64 Y88.0 S2546 M3

If you programme as above you will get used to the order and your programmes will be easier to read.

Consistency

G90 G0 G54 X12.64 Y88.0 S2546 M3

So you could begin with absolute or incremental (G90 G91).
Then rapid or feed (G0 or G1).
Then G54 (G55 G56…..) work offset.
Then X Y Z not Z Y X.
Then Speed S2546
Then turn on spindle M3

For example if the speed was always at the end of this line you would notice straight away if it was missing

It’s like reading a book we learn to recognise patterns.Reading

So although the running order does not matter, in terms of the way the programme runs, it is important from a visual point of view.

Running Order

Try to make your programmes consistent and to a regular pattern. Anyone using your programmes, including you, will find them easy to read and to fault find.

Remember if you are a programmer then the machinist, setters and operators are your customers so try and imagine the programmes from their perspective.

Rules

I often say to customers that I work with that it does not matter how you do a lot of these things but you must have a consistent approach.

Rules3

A good idea is to write a standard operating procedure (SOP) this would document exactly how the running order will be. If you are using CAD/CAM you will need to get into your post processor and make sure it outputs the code in accordance with your SOP.

Even down to leading zeros and training zeros do you programme G0 or G00 do you programme X.2 or X0.2. I know what I prefer because I hate wasting space (I am old school when memory space was sparse). It really does not matter but you must have a consistent approach and if you are not the only programmer, meet with your colleagues and come up with a plan.

Rules

If you don’t for example programme X50. Y60. Z80. in that order there is a good chance that you will alter the wrong figure and end up with two X figures or two Y figures.

Standardisation will mean less confusion and it will reduce errors.

Please contact me if you require:

  • Fanuc training.
  • CNC programming training.
  • Want to learn CNC programming.
  • Fanuc programming training.
  • Yasnac programming training.
  • Any type of CNC course.

Services offered at CNC Training Centre

Workholding devices (design and manufacture of jigs and fixture). Pneumatic or hydraulic clamping systems.

Edgecam programming and training.

Turnkey full solutions (Programming, fixture design, tooling, fully working solution, including training)

Classroom programmer training.

Onsite CNC Machine Training.

CNC Programming and 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.

[contact-form-7 id=”2706″ title=”Contact Form”]


Log out of this account

Leave a Reply

CNC Training Centre
WP to LinkedIn Auto Publish Powered By : XYZScripts.com