Using 'Safety Blocks' to begin the NC Code
|
While not all NC programmers will agree, Wahoo suggests that all NC programs should start with what are called 'Safety Blocks' of G and M codes at the start of the NC program. While it is true that some CNC controls will set motion and register defaults themself at program start, not all do and keep using whatever parameters were active when the last NC program was completed. It is also possible that someone else could change the defaults in the control without you knowing, and the results could be disasterous! If you simply make it a habit to include these defaults at the start of your files, or better yet set up your post processor in your CAM system to do it for you, there is a much less likely chance for surprises.
|
|
|
A complete listing on G and M codes are available at this site which discusses these codes is much more detail. For now, we will just talk a little about the ones that are recommended to be part of your 'Safety Block'. All G codes listed are for RS-274 compatible CNC controls. It is recommended that these defaults be programmed in your safety block: |
|
|
1. Define the units of your program as either inch (G70 on most controls,
occasionally G20) or metric (G71 on most, occasionally G21). |
![]() |
|
So... a good safety block definition is:
Keep in mind, some controls have a limit to the number of G codes that can be on a line. These controls would need multiple lines for the afety block, in some cases a seperate linefor each code. It is not usual for a CNC machine to need any default M codes in the safety block. If you machine has a programable brake and clamp through the M codes, you may want to add them as required. |
|
Copyright 2000, Wayne and Anita Hohler
All rights reserved. Unauthorized duplication Prohibited.
Questions or Comments about this site?
Please send to webmaster@xmlcreate.com
See our Disclaimer