NC Part Programming Principles

NC part programming adheres to the ANSI/EIA RS–274–D standard terminology with extensions for BNC and ISNC dialects. In addition, the NC programming facilities were designed to use as much of the WinMax Conversational system as possible. As a result, most of the screens are the same in both the NC and the conversational systems. This allows a smooth transition between the two.

The primary difference between conversational and NC programming is the program editors. NC programming uses standard G and M codes; whereas, conversational programming uses plain English or another supported programming language.

inset_000001.jpg 

The CNC software can read NC files from the serial port directly into dynamic memory or run NC files that are partially loaded into dynamic memory. NC files can be serially loaded to the hard disk.

NC part programs can be created using the CNC on the machine tool or off-line CNC programming software running on a personal computer. NC programs cannot be converted to conversational programs, nor can NC programs be converted automatically to any other NC format.

NC Part Program Components

NC programs are a series of characters and words that form program blocks. These program blocks tell the machine tool how and where to move. The operator needs to understand the basic program structure and the types of codes in order to create, edit, and run a program successfully. These components make up NC code:

Program Start

NC data can begin with the with a “%” (percent) character to indicate the beginning of the file. When a percent character is received, the control starts to accept, check, and load blocks into its memory. If you are creating a new part program at the control, the percent character is automatically inserted at the beginning of the program.

Sequence Number

A sequence number serves as a block label; it has no other significance within the part program except being required with GOTOs in NCPP and the M99 jump command. Sequence numbers are often used to mark the beginning of milling sequences so you can restart at a given sequence number or recall specific operations within the program. The maximum sequence number is 9999999.

When programming on an off-line system, sequence numbers should be used sparingly. Sequence numbers (N words) are optional in the NC Editor, and they are useful in programs sent over the RS-232 link. However, the absence of sequence numbers permits faster processing (loading, syntax checking, and parsing) of the part program and can result in improved part program execution. In addition, omission of these numbers increases the amount of the program that can fit into memory.

inset_1.jpg 

If you request renumbering of part program sequence numbers, any sequence numbers in GOTO statements will not be updated. You must then press the (F1) Yes softkey before re-sequencing will take place. To cancel the renumbering, press the (F8) No softkey. In general, you will not want to renumber part programs that use GOTO statements.

Address Characters

An address character is the first character of a word in a program block. The Ignore Command signals the system to ignore the remainder of the block. The Comment Command characters are used to delimit comments. The following is a list of the address characters recognized by this system:

/   

Ignore Command

( )

Comment Command

:

Subprogram Number (NCPP)

A   

Rotary Dimension Around X-axis

B

Rotary Dimension Around Y-axis

D

Tool Diameter Offset

F

Feedrate

G

Preparatory Functions

H   

Index into the tool length offset table

I

X-axis Arc Center/Offset, X scale factor, Canned Cycle Bore Shift

J   

Y-axis Arc Center/Offset, Y scale factor, Canned Cycle Bore Shift

K

Z-axis Arc Center/Offset, Z scale factor, Canned Cycle Repeat

L   

Tool Length Offset, Data Set Mode

M

Miscellaneous Functions

N

Sequence Number

O

Subprogram Number (NCPP)

P

Subprogram Number, Dwell Time, Scaling Factor

Q

Canned Cycle Bore Shift, Peck Depth

R

Rotation Angle, Return Level, Circular Interpolation Radius

S   

Spindle Speed Function

T   

Tool Select

X   

Primary X Motion Dimension, Dwell Time

Y

Primary Y Motion Dimension

Z

Primary Z Motion Dimension

Special Characters

Special characters are ASCII characters within a file which have special meaning to the system and cannot be edited. The following special characters are recognized by the NC software:

  • %Beginning/End of file—signals the system that all of the following characters are part of the program. The system automatically adds this character to the beginning of a new program. (% is not used in subprograms.) You can also include the % character to signal the End of File.

  • E —signals the NC system that no more legal program characters follow. This character is optional to provide compatibility with existing programs that include EOT characters at the end.

  • [CR]Carriage Return—signals the End of a Program Block.

  • [CRLF]Carriage Return/Line Feed Pair—signals the End of a Program Block (identical to [CR]).

inset_2.jpg 

[CRLF] is not shown when the program is viewed in the NC Editor.

Words

A word is a group of alphanumeric characters. The first character is an address character—a letter such as M or G. The address character is followed by a signed or unsigned numeric value. Some sample NC words are “X-.03” and “G00.” One word or groups of words form a program block.

Block

A block is a group of words terminated by the end-of-block character: a carriage return [CR] or a carriage return/line feed pair [CRLF]. Each block within a part program must be terminated with either a [CR] or a [CRLF].

The following illustration shows a typical NC block and its components:

NCBlockComponents.PNG

 

1 

Word

2 

Address character

3 

Numeric character

4 

Feedrate word

5 

Sequence number

6 

Modal preparatory functions

7 

One-shot preparatory function

8 

Dimension words

9 

Miscellaneous function

Default M and G Codes

Upon power up, control reset, initial entry into the NC Editor, or after erasing a program, the system presets these M codes as defaults:

M05      Spindle Off

M09      Both Coolant Systems Off

The system also presets certain G codes as the default active codes. The default G codes are highlighted in the G Code Table in the “Preparatory Functions-G Codes” section.

The system uses the units specified when the NC Editor is selected, not the G codes, for graphics display and running the part program.

Navigation

To move the cursor from a block to the beginning of the next block, press the down arrow (¯). Use the right/advance arrow (®) and the left/back arrow (¬) to move the cursor within a block. Use the Enter key to move the cursor between words and blocks.

To move to the beginning of the current block, press the Home key or the up arrow (­). If the cursor is already at the beginning of the block, pressing the up arrow moves the cursor to the beginning of the last word in the previous block.

To move from a word to the beginning of the next word, press the Enter key. If the cursor is at the end of the current block when the Enter key is pressed, the editor automatically presents the next legal address character.

To move from one character to the next, press the right arrow. If the cursor is at the end of the current block, the cursor wraps around to the beginning of the block.

To move from one character to the preceding character, press the left arrow. If the cursor is at the start of the current block, it wraps around to the end of the current block.

Delete characters or words from a block using these methods:

  • To delete numeric data, position the cursor on the number and press the Delete key.

  • To erase the entire word, position the cursor on the address character and then press the left arrow or the Delete key. The entire word is removed since numeric data is not allowed in an NC program without an address character to introduce it.