Upload
pejic1722
View
212
Download
0
Embed Size (px)
DESCRIPTION
CNC g-code program structure
Citation preview
Program Structure
Basic TermsCharacter
Word
Block
Program
These are the basic building bocks to creating a
program for a CNC system.
Character
Is the smallest unit of a CNC program
Digit
These are regular numbers that can range from 0-9
Letter
The 26 letters of the alphabet make up this section. Only certain letters are accepted
within a code. For example the letters X and Y for coordinates
Symbol
These consist of the decimal and minus sign as well as other various symbols.
Combined into Alpha-numerical Program input
All of these characters are combined into your program and are used to pass
instructions to the machine.
Word
Combination of characters
Creates single instruction
Will indicate
Axis
Speed
Feedrate
And more
Block
Multiple instruction
Multiple instructions can be created within blocks. This means that you are giving
various commands within one line of code. Each line is considered a block.
A line of code will be considered a block
Composed of words or characters
Using a return at the end of a line will end the block and start a new one
Program
Begins with a program number
Typically a program will have some sort of identifier or identification of its number.
May begin with a start code as well and a header of additional information.
Contains blocks of instruction
Blocks of code are created within the program to be run in sequence. A word
address is used in order to identify a specific register within the control memory.
(tells who is receiving the instruction)
Ends with a stop code or termination symbol
Format
CNC code will follow a Word Address Format
This is a combination of a single letter and one or more digits
This arrange creates the word
The address portion refers to the how the control memory registers the specific
words.
The letter must be written first and define the meaning of the word
Some Examples of Common Words
G01 Preparatory command
M30 Miscellaneous function
D25 Offset number selection - mills
N105 Sequence number (block number)
Y0 Coordinate word
T05 Tool function
T0505 Tool function
F12 Feed rate function
S2500 Spindle sped function
Sample Code to be created