CNC Program Entry and Editing On Fanuc Machines S.K. Sinha
CNC Program Entry and Editing On Fanuc Machines S.K. Sinha
~~*~O~*~~*~~~v~ouoo~oouou~~~ooo~~uo~~uooov~uo
u
u
~
a
a
~
~
~
~
~
~
a
a
~
a
a
u
0
0
u
u
~
;
~
~
Programming Skills: ~
\\ mir ,
.1
;: "
(r
po
'
;:
~;:
on
f
r.
r
.,
1
~
~
~ Fanuc~:Mochines ~
"aa
(r
~
~
~
a~
~
~
~
~
"
""
""
"~
"n
~
~
~
:"
~
t#-0
:Q:
S. K. SINHA .
'(.,0
:"
"
V'fl'tt(rVOOWVOOVbUO
Table of Contents
Preface
MDI panel
MOP panel
Soft keys
Entering a new program
Editing I executing an existing program
Deleting a program
Copying an entire program
Preface
This is the first book in the series CN C Programming Skills.
Do you know how to insert a part of a program into another program at the desired location? Background
editing?? Using PCMCIA card??? Or, maybe, a simple task such as replacing Go2 by G03 in the whole file????
When it comes to manual program entry on the machine, or searching I deleting I editing I copying I moving I
inserting an existing program residing in the control memory or the PCMCIA card, most people resort to trial and
error method. While they might be able to accomplish what they desire, the right approach would save a lot of their
precious time. If this is exactly what you want, this book is for you. The information contained herein is concise,
yet complete and exhaustive. The best part is that you can enjoy the convenience of having the wealth of useful
information on editing techniques even on your smart phone which is always with you! You would often need to
refer to it because it is not possible to memorize all the steps which are many a time too complex and devoid of
common logic, so as to make the correct guess.
The procedure for program entry I editing on a Fanuc oi control is explained after the definition of some key
words, which applies to all i-series control versions.
Happy editing...
MDI panel
The keyboard which is an integral part of the LCD screen is called MDI (manual data input) panel. This is
supplied by Fanuc and has a standard configuration for a particular control version I model. Fanuc oi standard MDI
has 24 address I numeric keys, 6 function keys (POS, PROG, OFSISET, SYSTEM, MESSAGE, and CSTMIGR keys),
3 edit keys (ALTER, INSERT and DELETE keys), one SHIFT key, one CAN key, one INPUT key, one HELP key, one
RESET key, 2 page change keys and four (left I right I up I down) arrow keys. The MDI panel is used for typing I
editing a program and also for entering data for changing the software settings (such as setting system parameters
for the overtravellimits, etc.) of the machine.
One can type a new program or edit an existing program directly on the MDI (Manual data input) panel of the
machine in the EDIT mode. The control saves whatever we type, the moment we press the INSERT key on the MDI
panel (except in background editing mode, described later). Similarly, if we delete a word(s) or a block(s), it is gone
forever. A deleted file also cannot be recovered. There is no undo key or a recycle bin. So, if the backup of the old
file is also desired, it has to be copied into a new file and then edited. The programs are executed in the automatic
(AUTO) mode which is also referred to as the memory (MEM) mode. Small programs, which need not be saved for
a future use, can also be executed in the manual data input (MDI) mode. Manual movement of the tool, say, for the
purpose of offset setting, can be done in JOG I Handle mode. EDIT mode is only for the purpose of editing.
MOP panel
This panel (machine operator's panel), which does not have a standard configuration, is for selecting machine
modes (EDIT, AUTO, REMOTE, MDI, JOG, INC, HANDLE, REFERENCE and TECAH modes, all of which may not
be available on all the machines) and for hardware control of the machine such as coolant ON I OFF, spindle ON I
OFF, feed drives ON I OFF, tailstock forward I retract, tool change, various overrides, program execution start I
stop, feed hold, single block execution, block skip, optional stop, emergency stop etc. The panel also has some key
switches for edit lock, machine lock, auxiliary (MST) lock, external I internal chucking, emergency override etc.
Keeping in view the capability of a machine (all the control features are not implemented in all the machines), the
MOP panel is designed by the machine tool builder (MTB) who makes the hardware part of the machine and
installs on it the control supplied by Fanuc (or some other company). The control of the machine is a complete
package of the electronic parts as well as compatible servo motors I encoders with feedback circuits, servo
amplifiers, cables etc. It is interesting to note that the machine control unit (MCU), i.e., the box which houses all
the PCB's of the control is just about the size of a standard dictionary, irrespective of the size of the machine!
Soft keys
Just below the LCD screen, there are 7 buttons, which have conteA.'t based (as defined by the function keys on
the MDI panel and subsequent selection of soft keys) multiple functions . In a particular application, the meaning
of each button is displayed just above it. Since the functions of these bottoms vary and are software dependent,
these are called soft keys. The extreme left button ( -<1111 ) and the extreme right button (.,.. ) are for return menu and
next menu (remaining options which could not be displayed due to lack of space), respectively. In most cases,
OPRT (operation selection key) is indicated for the second button from the right. This button opens the menu for
the possible operations on the selection made by the remaining four buttons (which are called chapter selection or
context selection soft keys). In many cases, the chapter selection keys have a tree structure, i.e., selection of one
chapter may open up several chapters, some of which may again have several chapters, and so on.
After typing each complete word (e.g., N10o, Go1, Mo3, X12.5, S10oo etc.), press the INSERT key. At the end of
a block, press EOB (end of block) key, followed by INSERT key. This will insert a semicolon, after which typing
starts from the next line. Insert EOB after 01234 also, to change the line. Note that it is not necessary to start
typing the program from the second line, but it "looks" better that way. Insertion is done after the highlighted
word. It is permitted to insert multiple words in one step - just type them sequentially, and press INSERT after
typing the last word. In fact, multiple blocks (separated by EOB, i.e., semicolons) also can be inserted in one step, in
the same manner.
While specifying the distances along different axes, be careful that a parameter setting may cause the integer
values (i.e., distances in whole numbers) to be interpreted in the least input increment of the machine, i.e., as
multiples of one micron (in mm mode). For example, X1o may be interpreted as 10 microns along X-axis. So, it is a
safe practice to use X1o.o (or simply, X10.), if 10 mm is implied. The least input increment in inch mode is 0 .0001
inch. So, in inch mode, X1o may be interpreted as 0 .0010 inch. The least input increment is the mechanical
resolution of the machine - the minimum distance by which the tool can be made to move along an axis, from its
present position. In fact, a two dimensional (three dimensional on a 3-axis machine) uniform grid v.rith the grid
spacing equal to the least input increment can be thought to exist in the work envelope of the machine. The tool
can only move to the discrete grid points - it cannot stop at an intermediate position. This happens because the
control of the machine is digital, not analog.
For the purpose of editing or for simply displaying the desired blocks I words of the program, move the cursor
using left I right I up I down arrow keys and page up I page down keys, as needed. The position of the cursor is
indicated by highlighting the word at that position. The complete word is highlighted and the cursor moves word by
word (by left I right arrow keys). This means that any editing operation is possible only on complete words- you
cannot edit a part of a word; edit the whole word. In the discussion that follows, "bringing the cursor to a word" and
"highlighting a word" - both mean the same thing.
Use CAN (cancel) key to delete one character at a time (backwards) while typing. DELETE key deletes the
whole of the highlighted word. If a word is to be replaced by a new word, highlight the old word, type the new word
and press the ALTER key. The program number (0-word in the first line of the program) and the end of file
character(% character in the last line) cannot be deleted or altered.
For deleting a complete block (each line of a program is called a block in CNC language), place the cursor on
the first word of the block, press EOB, followed by DELETE keys. Instead of placing the cursor on the first word, if
it is placed on some other word, then all the words of that block except those lying to the left of the highlighted
word would be deleted. It is also possible to delete multiple blocks, provided the last block to be deleted has a
sequence number (say, No10oo) - instead of EOB, type No10oo and press DELETE.
It is also possible to search a word (which consists of a letter address followed by data, e.g., S1200) by typing
it fully or typing its address only, and pressing the soft key SRH! or SRHt for forward I backward search. For
example S1200 cannot be searched by typing S1, but it can be searched by both S1200 and S. Also, leading zeroes at
the left of a data are not ignored in a search operation. For example, So10o cannot be searched by typing S10o. Type
either So10o or just S. Typing just the address is very convenient if, for example, you want to examine the spindle
speeds (S-word) specified in the whole program, one by one. For this, typeS and press SRH! repeatedly, till you
reach the end of the program where the search ends.
Comments, if any, must be enclosed between left and right parentheses, i.e., "("and")" characters which are
called control out and control in characters, respectively, and the INSERT key should be pressed after the end of
the complete comment.
If the MOP has a block skip switch, insert the slash character, I, in the beginning of a block to skip it optionally
(depending on the ON I OFF setting of the block skip switch on the MOP, at the time of reading the program),
during the execution of the program. For multiple block skip switches (if provided), insert 11, 12, 13 etc. (a
maximum of nine block skip switches may be available), corresponding to the respective switch numbers. Some
controls (including Fanuc oi) allow the slash symbol even in the middle of a block (mid block skip) for the purpose
of skipping the part of the block lying to the right of the slash, but it might cause confusion because the slash
character is also used for the division operation in a macro statement (i.e., a statement in terms of variables). If the
purpose is division, then it must be enclosed in square brackets. For example, in #101 = [#100I2], the slash means
division, but in #101 = #10012, the slash means mid block skip (if the block skip switch is ON), which sets #101 =
#100. However, it is better to use conditional (IF _ GOTO _ )or unconditional (GOTO _ )branching instead of
using block skip. Block skip was originally designed for machines not having macro programming option.
Use arrow keys and page up I page down keys to move the cursor wherever desired. The left I right arrows
move the cursor backward I forward, one word at a time. The up I down arrow keys move the cursor to the first
word of the previous I ne}.'t block Page up I page down keys move the cursor to the first word of the previous I next
page. In all cases, the movement will be continuous if you hold down the keys. The RESET key places the cursor on
the first word of the program.
The MDI panel usually has just one key for the left bracket and another one for the right bracket. While typing,
whether the bracket v.rill appear as a square bracket or a parenthesis, depends on a parameter setting. If the
machine has Fanuc oi or a similar control, set parameter 3204 #0 to o for a square bracket, and 1 for a parenthesis.
The first bit (from right) of an 8-bit parameter is referred to as bit #O (the eight bits are designated as # O through
#7, starting from the right). Obviously, it would not be possible to use square brackets as well as insert comments
both at the same time, with this parameter setting. If some comments are desired to be inserted in a macro
program, first type I edit the program using square brackets, wherever required. Then change the parameter setting
to get parentheses, for the purpose of inserting comments. After inserting comments, if again some corrections in
the program, involving square brackets, are needed, another change in parameter 3204 would be required.
There is, however, a way to use both types of brackets, v.rith the same parameter setting. For this, set parameter
3204#2 to 1 (3204#0 should remain o . Status of the other six bits of this parameter does not affect this feature) .
Such a parameter setting displays an e}.'tended character set, as soft keys, in the EDIT mode, displaying "(",")" and
"@". With this setting, if square brackets are needed, use the bracket keys on the MDI panel, and if parentheses are
needed, do the follov.ring (in EDIT mode):
Press PROG on MDI panel (Press PROG again if the current program is not displayed).
Deleting a program
Assuming that the existing program number 1234 is to be deleted, carry out the follov.ring steps:
Select the EDIT mode on the MOP panel.
Press the PROG key on the MDI panel.
Type 01234 ("O" has to be typed; simply 1234 will not do.) and press the DELETE key on the MDI
panel.
It is also possible to delete all programs v.rithin a defined range, in one step. For example, if all the programs
including and lying between program numbers 1000 and 2000 are to be deleted, then in the third step, type
010oo,02ooo and press the DELETE key. For deleting all the programs, type 0-9999 and press the DELETE key.
a new program number oooo is created. This program can be edited in the usual manner, but cannot be executed.
Restriction: Not more than 15 characters can be specified for old or new words.
Background editing
Editing a program while executing another program is called background editing. The methods of editing are
the same as those for ordinary editing (which is called foreground editing), discussed earlier. Though a program
cannot be executed in EDIT mode, it is permissible to change to EDIT mode once the program starts executing.
Assume that while program number 1234 is executing, program number 2345 is to be edited in the background.
The following steps are needed:
Select the EDIT or AUTO mode on the MOP panel.
Press the PROG key on the MDI panel.
Type 01234 (or simply 1234) and press the 0 SRH soft key.
Change to AUTO mode and press CYCLE START on the MOP, after setting proper conditions for
machining. The program will start executing (Do take all the standard precautions for executing a
program.).
Press the PROG key on the MDI panel.
Press the soft key OPRT. If OPRT does not appear, press the return menu soft key ( ~ ).
Press the soft key BG-EDT (background editing). The background editing screen will appear,
displaying PROGRAM (BG-EDIT) at the top left corner of the screen.
Type 02345 (or simply 2345) and press the 0 SRH soft key.
Now edit the program in the usual manner. After the background editing is complete, press the
soft key OPRT (if BG-END does not appear), followed by BG-END (background editing end).
Restriction: In background editing, no attempt should be made to make any change in the program being
executed. Also, the program being executed cannot call (as a subprogram) the program being edited in the
background. Note that alarms of foreground operation (execution, in this case) do not affect the background
operation, and similarly, alarms of the background operation do not affect the foreground operation. To
differentiate between the two categories of alarms, the term P/S alarm (position I setting alarm) is used for the
foreground alarm, and BP/S alarm is used for the background alarm.
= old file number + 1) to fill the created gap. Some possible operations on a memory card are described ne.'t.
Note that file number 12 need not be a part program file. It can be, for example, a parameter file, which will be
saved in a format similar to a notepad file, as program number 1234. If program number 1234 already exists in the
memory of the CNC, then it may or may not be ovenvritten depending on a parameter setting. While working with
the memory card, if it is required to see I edit I delete the directory I programs saved in the control memory, press
PRGRM soft key. If PRGRM is not displayed, press the return menu soft key (..,.. ). For coming back to the card
directory, repeat the initial steps (PROG next menu CARD). Repeat the last three steps to copy more files.
When file number 12 is deleted, this file number is assigned to the next file, and all the subsequent files are
renumbered (new file number= old file number- 1). The numbers of the first 11 files (in this case) remain
unchanged. Files on a memory card can only be deleted by file numbers; file names cannot be used.
Disclaimer: Though every care has been taken to ensure that the descriptions given in the text are error free
and work as intended, the author does not assume any responsibility for any inadvertent error that might have
crept in. Any unexpected result as well as suggestions for further improvement / next book in this series would be
gratefully acknowledged. These can be sent to the author at sinha_ [email protected].
Author's personal request: If you enjoyed reading this book and would like to recommend it to other CNC
users, please go back to the Amazon's site and post your review. This would encourage the author to bring out
another book in this series.
Author's profile:
Dr. S. K Sinha is a Mechanical Engineering graduate of Indian Institute of Technology, Kanpur (India). He
obtained Master's degree and Doctorate also from the same institute. He has published a book on basic CNC
programming as well as another one on macro programming, among several of his publications. Presently, he is a
Professor in the Department of Mechanical Engineering at Indian Institute of Technology, Varanasi (India).