User Manuals
Drill Fundamentals
Drill Parameter
Part Programs
Unix Help For UCS
Machine Setup Commands
|
MANUALS
The Editor
The editor is what you use to create or modify part programs from the
keyboard of your CNC-7. The editor consists of a special display (called
the edit page), and a series of keyboard commands which are used to create
or modify files.
The editor can be used to create or modify any ASCII file. This includes
part programs, MACH.DAT files, or PASSWORD.DAT files to name just a few.
You can used the editor any time after software has been loaded, even while
a part program is running on the machine. When you use the editor, the
Operating System assigns a section of memory to the editor. It will not
interfere with other operations of the CNC-7. However, when the CNC-7 is
running a part program on the machine, the part program has priority, and
the editor will take longer to perform its functions.
The CNC-7 editor, unlike previous control systems, loads the entire file
to be edited into memory. There is no "buffer" as with the CNC-6, which
requires you to move sections of the file in and out of memory. Line 1
and line 100,000 can be in memory at the same time.
NOTE: While you are in the Editor (or a number of other functions which use
the keyboard) a special popup window is enabled. By touching the screen, you
can bring up this popup which allows you to start or stop the machine.
See also: PANIC PANEL
Getting started with the editor
Entering the editor
The editor can be entered from any page displayed on the screen by typing
the edit page (EP) command and pressing the return key. It may also be entered
by the touch of a button from the File Utilities page. There are three basic
ways to enter the editor:
EP with no parameters will cause the system to prompt you for the device
and file names to be used. This is done using the file selection window.
EP,file will cause the system to directly enter the editor, assuming that
enough information is provided. If you provide only a file name, it will prompt
for a device. If you provide only a device, it will prompt for a file name.
Again, these prompts are done using the file selection window.
An Edit button is located on the File Utilities page. Pressing
the button displays the Input/Output selection window (Please refer to
FILES for a description). This window allows you to edit a previously
selected file, or you may specify new input/output devices or files.
The editor output defaults to the input file, meaning that your edits
will be applied to the input file unless you specify a different output
device or file.
The file selection window used in conjunction with the Input/Output
selection window also allows you to "tag" files in order to edit multiple
files. After selecting your file(s), you enter the editor by pressing the
Execute button.
Inputs and outputs
When we talk about input and output in this chapter, think of the editor as
some kind of container. We put files into the container, work on them, pull
them out and put them somewhere. An input is a part program, or other file,
which we get from a disk drive or some other device, and input (transfer)
to the editor.
We can use the editor to modify the file, or just look at the file without
modifying it. Then we can output (transfer) the file from the editor to a
storage device such as a disk drive.
Inputs and outputs must be thought of in relationship to whatever software you
are working with. If you are loading a part program into the CNC-7 to run the
machine, the part program is an input to the machine. The drilled PC board
would be an output.
Creating files
If you want to create a new file with the editor, simply enter the editor
with a filename which doesn't exist yet. For example, if the device you are
working with contains the files AAA, BBB, and CCC, you might want to create
the file DDD. To do this, simply provide DDD as a file name, either from the
keyboard, or in the file selection window.
Typing text
When the edit page appears, it will either be blank or display blocks of
text, depending on the input file you specified. If your input source is an
existing file, the first 18 blocks of the file will be displayed, as shown
in the following illustration:
If you specified a new file as input, the edit page will be blank.
Let's assume that you specified a new file as the edited file, and you
want to create a new file. The screen will look something like the screen
shown above. Near the top of the screen will be the words , followed
by the line number "1." and the cursor will be to the right of the line number.
The editor is now ready to accept your program, and you are in insert mode,
which is described in the next section.
Insert mode vs command mode
There are two basic modes of operation in the editor: insert and command.
Briefly, they are as follows:
Insert mode allows you to type your part program lines onto the screen and into
the buffer.
Command mode allows you to use all of the editor commands, such as LIST,
DELETE, TOP, etc. In command mode, a command queue similar to that available to
you on the Front Page can be used. By pressing the UP and DOWN arrows on the
keyboard, the last 20 commands can be recalled and reissued. This can be
very useful when doing repetitive editing. Command line editing (other than
deleting from the end of the line) is not supported by the editor.
The insert mode will cause the screen to appear as described in the above
figure, or the following figure. To enter insert mode, type the insert command,
described later in this chapter, and the prompt displays as a block number,
followed by the cursor.
In insert mode, anything you type after the prompt will become part of your
file. When you have finished typing a coordinate or other part program
line, press the RETURN key. Another block number will appear just below the
first. Each time you type a line and press the RETURN key, the editor will
display the next sequential number on the next line.
When you want to stop entering data, respond to the prompt by pressing the
RETURN key. This will take the editor out of insert mode, and return you
to command mode.
Block numbers
The following figure shows a portion of a part program with a block number to
the left of each block. Notice that the numbers are whole numbers followed by
a period. These block numbers are not part of the commands. They are assigned
to your program by the editor to keep track of each block. These numbers enable
you to search through the text, add or delete blocks, insert blocks from other
files, and do other kinds of editing of the text.
When you insert text into an existing file, each inserted block is assigned
a sequential number, preceded by a period. These inserted blocks are extensions
of the block number where you began inserting. The figure shows how two blocks
are inserted at block six, and the next figure shows how the inserted blocks
would appear after relisting the file from the beginning.
Notice how each inserted block becomes an extension of block six. This is the
method used by the editor to keep your file in order as you are manipulating
text. Later in the editing session, if you want to refer to one of the inserted
lines, you would refer to it as 6.1 or 6.2.
When you finish editing your file, you will most likely store it on a disk
drive or paper tape. The block numbers assigned by the editor are not stored
with the file, they are ignored. If you load the file back into the editor,
it will be displayed as follows:
Notice that the blocks have been renumbered: 6.1 became 7, 6.2 became 8, etc.
Each time the editor loads a file into the buffer, it assigns a fresh set of
numbers, starting with one. As each block is loaded, the next sequential
number is assigned.
The pointer
When you are editing text, the editor keeps track of your location in the
file. The editor does this through something called a pointer. The pointer
keeps track of the address of the block you are working on. The pointer is
not the same as the cursor on the screen, although often they are at the same
block. The pointer is an invisible device.
When you load a file into the editor, the pointer is at the first block
in the file. The cursor is at the prompt at the bottom of the page. If you
use the insert command ("I"), described later in this chapter, the prompt
will become a block number as we described earlier. The cursor and the
pointer are now at the same block.
Using the editor commands
The editor uses a special set of commands, called editor commands, which allow
you to manipulate blocks of text in the edit buffer. Editor commands are used
just for the editor and have nothing to do with part program commands. When you
are in the editor, only editor commands are recognized.
All editor commands are used in the command mode. When you use them, the
editor remains in the command mode. The exception to this is the insert
command which puts the editor into insert mode.
Editor commands can be separated into eight groups:
o Buffer movement commands
o Change command
o Delete command
o Find command
o Insert command
o List command
o Replace command
o Miscellaneous commands
Most of these command groups are actually individual commands by themselves.
However, each has many variations. Each of the commands is described as
follows:
o What the command is used for
o How to type the command
o What options are available to you
o Examples of proper usage
Quotation marks
Some of the commands used with the editor allow you to search for specific
text, or to add, delete, or replace text. Generally the format of the command
is: COMMAND,"text", using single quotation marks. Double quotation marks are
also allowed, as long as you enclose the text in either single or double. Do
no start the text with a single and end with double, or vice versa.
Buffer movement commands
Buffer movement commands are a set of different commands which move the pointer
through the buffer. They don't affect any data in the buffer, but they do
change the address of the pointer.
These commands assist you in using all the other editor commands properly and
efficiently.
The buffer movement commands are as follows:
T Top of buffer
T stands for TOP. Use this command to quickly move the
pointer to the top of the file. The pointer will move
to the first block of the file, regardless of where it
was before the move.
Type a T and press the RETURN key. The editor will
display the following:
0.>
E End of buffer
E stands for END. Use this command to quickly move the
pointer to the end of the edit buffer. The pointer will
move to the last block in the buffer, regardless of
where it was before the move.
Type an E and press the RETURN key. The editor will
display something like the following:
1576. M30
1576.>
+n Move forward in buffer
Moves the pointer down in the buffer. In place of "n",
type the number of blocks you want to move forward and
press the RETURN key. The pointer will move and the new
block will be displayed on the screen.
Example of usage:
Move the pointer to the fourth block in the buffer:
1576.> T
0.> +4
4. X05382Y07062
4.>
-n Move backward in buffer
Moves the pointer up in the buffer. In place of "n",
type the number of blocks you want to move backward
and press the RETURN key. The pointer will move and
the new block will be displayed on the screen.
Example of usage:
Move the pointer to the next to last block in the
buffer:
4.> E
1576. M30
1576.> -1
1575. M08
1575.>
n Move to line number
Entering a line number directly, followed by RETURN
causes the system to move directly to the block
number specified.
ESC Move backward one line
The ESC (escape) key causes the pointer to move one
block up in the buffer, each time it is pressed
followed by a RETURN. The new block will be
displayed on the screen. This command is the same
as typing -1 with the "-n" command above.
RETURN The RETURN key
This key causes different effects, depending on what
mode you are in:
In command mode, after you type a command, press the
RETURN key and the editor will perform the command.
If you have not typed a command, pressing RETURN
moves the pointer down one block in the buffer. This
if the same as typing +1 with the "+n" command above.
In insert mode, after you have typed a new block,
pressing RETURN causes the editor to accept what you
have typed. If you have not typed anything in the
block, pressing RETURN takes you out of the insert
mode.
Change Command
The Change command allows you to modify the text in a block, or multiple
blocks, with a single command. Without this command you would have to delete
the block(s) are retype it in the insert mode.
This command allows you to correct typing mistakes, change pattern names, or
edit a block for any other reason. It is especially useful for editing
several blocks at the same time. It is possible to make massive changes
throughout the entire file with one command.
There are five variations of this command. In each variation, the text
specified between quotation marks is substituted in place of the text
between another pair of quotation marks. The length of the text does not have
to be the same. If you want, you can substitute many characters in place
of a few, or vice versa.
When you substitute extra characters, all the remaining characters to the
right of the edit will be pushed to the right. When you substitute fewer
characters, all the remaining characters to the right of the edit will move
to the left.
Additionally, the text may be anywhere in a block, with characters on both
sides. The Editor will affect only the text you specify, and leave the rest
of the block untouched.
Whenever you use a change command, the changed block(s) will be displayed
on the screen.
The five variations of the Change command are as follows:
C,"txt1"txt2" Single block Change
Substitutes txt2 in place of txt1 at the pointer block. If txt1 occurs more
than once in the block, only one occurrence will be changed. After typing the
command and pressing the RETURN key, the block will be displayed with the
new text.
Example of usage: C,"X03"X03261"
This will change the following block
from: X03Y09475
to: X03261Y09475
/txt1/txt2/ Quick Change
This is the Quick Change command. It works the same as the C,"txt1"txt2"
command above.
Example of usage: /X032/X067Y142/
This will change the following block
from: T1X032
to: T1X067Y142
C,""text" Change Insert
Inserts text before the first character in the block at the pointer. There
are two quotes before the text and one after it. If you type double
quotation marks, the command will look like: C,""text".
Example of usage: C,""X200"
This will change the following block
from: Y137
to: X200Y137
C,L,"txt1"txt2" Change Line
Operates the same as the first command, above, except that all occurrences
of the text in the pointer block will be changed.
Example of usage: C,L,"T04"T03F200"
C,A,"txt1"txt2" Change All
Substitutes txt2 in place of txt1 for the first occurrence of txt1
in each block, for all blocks within the file being edited.
Example of usage: C,A,"M24"M01"
C/n,"txt1"txt2" Change "n" occurrences on line
Substitutes txt2 in place of txt1 for the number of occurrences you
specify in place of n, for the pointer block only.
Example of usage: C/2,"01"02"
This will change the following block
from: G01X013439Y018401
to: G02X023439Y018401
C,A/n,"txt1"txt2" Change "n" occurrences in all blocks
Substitutes txt2 in place of txt1 for the number of occurrences you specify
in place of n, for all blocks in the file. This command can be used with
macros, discussed later in this chapter, because they will perform automatic
substitution throughout the entire edited file.
Example of usage: C,A/1,"X01Y02"X02Y02"
This will change the following sample block
from: X01Y01G85X06Y06
to: X02Y02G85X06Y06
C,"txt1?txt2"txt3" Change with wildcard
Substitutes the text you specify in place of txt3 for any occurrence of
text beginning with txt1 and ending with txt2. The question make allows any
quantity of characters to occur between txt1 and txt2. This command affects
the pointer block only.
Example of usage: C,"C?T"CELLON"
This will change the following block
from: M98,EXCELLENT
to: M98,EXCELLON
Delete command
This command allows you to selectively remove (erase) blocks from the file.
You may use it to delete one block or a series of blocks, or all blocks
containing certain text. When you type the command and press the RETURN key,
all the blocks you specified will be permanently deleted from the edit
buffer.
Blocks which are deleted may not be restored, except by retyping them at
the keyboard. If you mistakenly delete a big chunk of blocks in the edit
buffer, you can abort (end) the edit session with the FP command, and reload
the original input file.
NOTE: Deleting large sections of the buffer (several thousand lines) can take
a little while. For example, deleting more than 10,000 lines can take over
30 seconds. You'll get a message if this is going to happen.
The FP command is discussed later in this chapter.
There are six variations of the DELETE command, as follows:
D Delete current block
Deletes the block at the pointer. The pointer will move down to the
next block.
D,n Delete line "n"
Deletes the block that you specify with a line number in place of "n".
Example of usage: D,63
D,n1,n2 Delete blocks from "n1" to "n2"
Deletes a series of blocks, beginning with the block at line "n1", and
ending with the block at line "n2".
Example of usage: D,117,134
D,/n Delete "n" blocks starting at current
Deletes the quantity of blocks you specify in place of "n", beginning
with the block at the pointer. For example, you may want to delete the
next 10 blocks.
Example of usage: D,/10
D,n1/n2 Delete "n2" blocks starting at "n1"
Deletes the quantity of blocks you specify in place of n2
beginning with the block number you specify in place of n1. For example
you may want to delete 20 blocks starting with block number 592.
Example of usage: D,592/20
D,"txt" Delete all blocks containing "txt"
Deletes all blocks from the pointer forward through the end of the buffer
which contain the text you specify in place of "txt". The Editor examines
each block to determine if it contains the text anywhere in the block,
even if there are other characters before and after the text. If the text
is found, exactly as you specified, the entire block is deleted
from the buffer.
Example of usage: D,"T06"
The following blocks will be deleted:
T06F200S61
T06
Find command
This command is used to search your file for specific text or a block
number, and display the block when it is found. When you type the command,
specify what the editor is to search for. If the editor finds a match,
the block found will display on the screen.
The Find command will locate and display only the first matched block. If
you want more blocks displayed, you should use the List command (L),
described later in this chapter. When you specify a block number, the
Editor will locate that block and display it on the screen.
If you are looking for specific text, you have the option of finding the
first occurrence of that text, or specifying a different occurrence. The
Find command will locate the specified occurrence of the text, display it
and stop looking.
For example, you may have used the G82 command elsewhere in your program.
With the Find command you can quickly skip to the G82 block and display it
on the screen. Or you may want to locate the second or third occurrence
of the G82 command in the program.
There are four variations of the Find command:
F,n Find block number "n"
The buffer will be searched, from beginning to end, looking for the block
number specified in place of "n". The Editor will display only one block,
if it exists.
Example of usage: F,162
n Find block number "n"
This is a shorthand command to find a block by its block number.
The buffer will be searched, from beginning to end, looking for the block
number specified in place of "n". The Editor will display only one block,
if it exists.
Example of usage: 83
F,"txt" Find Text
The buffer will be searched, from the pointer to the end of the file, looking
for the text you specify between the single quotation marks. The Editor
examines each block in succession to determine if it contains the text
anywhere in the block, even if there are other characters before and after
it. If the text is found, exactly as you specified, the entire block is
displayed on the screen.
The F,"txt" command will locate only one block. Once the block has been
found, the Editor stops searching.
Example of usage: F,"T06"
The following block will be displayed:
T06F200S61
nF,"txt" Find "nth" occurrence of text
Searches from the pointer to the end of the file, for repetitions of the
text you specify between the quotation marks. In place of "n" in the
command, you specify the number of times the text occurs starting from
the pointer. The Editor will display the one block which is the nth
occurrence of the text.
For example, display the second time the G85 command is referred to
in the part program:
2F,"G85"
Insert command
This command is used to insert blocks of text into your file. The blocks can
be either typed at the keyboard, or inserted from another file outside the
edit buffer.
The Insert command is a time saver for programmers. You can store Step and
Repeat sequences, or part program headers, as separate files on a disk. You
can then use the Insert command to insert a copy of one of them into your
program.
This command has four variations, all of which place the Editor in the Insert
mode. To stop inserting, respond to the prompt by pressing the RETURN key. The
Editor will return to the command mode.
When you insert text into an existing file, each inserted block is assigned
a sequential number, preceded by a period. These inserted blocks are extensions
of the block number where you began inserting.
The four variations of this command are as follows:
I Insert from keyboard at pointer
Begins inserting blocks between the pointer and the next block in the file.
On the screen, the Editor displays a block number followed by the cursor (_).
Anything you type after this prompt will become part of your file.
When you type text, and press the RETURN key, the prompt moves down one line
on the screen, and the next sequential block number appears, ready for typing.
Each time you type text and press the RETURN key, the prompt moves down one
line. When the prompt nears the bottom of the screen, each block will move up
one line (scroll) on the screen, and the top block will disappear.
To stop inserting blocks, respond to the prompt by pressing the RETURN key.
I,n Insert at line number "n"
Begins inserting after the block number you specify in place of "n".
Otherwise, this command operates the same way as the "I" command above.
I,"file" Insert file at pointer
Inserts a file into the edit buffer starting at the current pointer position.
"file" is the name of a device and/or file.
The inserted file may come from any of the valid devices on the system, such
as paper tape, DNC, hard disk, floppy, or the Ethernet network, depending on
how your system is configured.
Inserting a large file (over 5,000 lines) will require that the editor line
numbers be resequenced. If this happens, you'll get a message to this effect.
Example of usage: I,"HDR12"
I,n,"file" Insert file at line number "n"
Inserts a file after the block number you specify in place of "n". "file"
is the name of a device and/or file. Otherwise, this command operates
the same way as the "I,file" command above.
For example, to insert a stored pattern after block 186:
I,186,"PATTERN75"
List command
This command is used to display a series of blocks on the screen. You can
display the entire file or just small portions of it, or you can display only
blocks containing specific text of your choice.
After typing each command, press the RETURN key. Up to 18 blocks will be
displayed on the screen. If there are more to be displayed, the CNC-7 will
prompt you to press the Space Bar to continue with the listing.
There are seven variations of the List command. With each variation, the
screen will display up to 18 blocks. If there are more to be displayed, a
message will appear at the bottom of the screen:
Press the Space Bar and the next 18 blocks will display. Repeat this process
until you reach the end of the listing. To stop the listing at any time, press
the RETURN key.
The seven variations are as follows:
L List from pointer
All of the contents of the edit buffer, from the pointer to the end of the
buffer, will be listed on the screen.
L,A List all of buffer
All of the contents of the edit buffer, from the beginning to the end, will
be listed on the screen. The listing will begin with the first block in the
edit buffer, regardless of the location of the pointer.
L,n List from line number "n"
All of the contents of the edit buffer, from the block number specified in
place of "n", to the end of the buffer, will be listed on the screen.
Example of usage: L,162
L,n1,n2 List from line "n1" to line "n2"
Displays a series of blocks, beginning with the block number you specify
in place of "n1", and ending with the block number you specify in place
of "n2".
Example of usage: L,142,176
L,/n List "n" blocks starting at pointer
Displays the quantity of blocks you specify in place of "n", beginning with
the pointer. For example you may want to display the next 30 blocks.
Example of usage: L,/30
L,n1/n2 List "n2" blocks starting at block "n1"
Displays the quantity of blocks you specify in place of "n2" beginning with the
block number you specify in place of "n1". For example you may want to display
30 blocks starting at block 220.
Example of usage: L,220/30
L,"text" List all blocks containing "text"
Displays all blocks, from the pointer to the end of the buffer, which contain
the text you specify between the quotation marks. The Editor examines each
block to determine if it contains the text anywhere in the block, even if there
are other characters before and after the text. If the text is found, exactly
as you specified, the entire block is displayed on the screen.
L,"text" can be used in place of the F,"text" command described earlier in this
chapter. However, it will list all occurrences of the text in the buffer, not
just the first.
Example of usage: L,"T06"
The following blocks will be displayed
T06F200S61
T06
Replace command
This command is essentially a combination of the Delete and Insert commands.
The Replace command deletes one or more sequential blocks, and then goes into
the insert mode where the first block was deleted.
There are four forms of the command as follows:
RP Replace block at pointer
Deletes the block at the pointer. After the deletion, the Editor goes into
the insert mode where the pointer block was deleted.
RP,n Replace block number "n"
Deletes the block you specify in place of "n". After the deletion, the Editor
goes into the insert mode where the block was deleted.
Example of usage: RP,160
RP,n1,n2 Replace blocks "n1" through "n2"
Deletes the series of blocks you specify, starting at block "n1", and ending
at block "n2". After the deletion, the Editor goes into the insert mode
where the first block (n1) was deleted.
Example of usage: RP,160,846
RP,n1/n2 Replace "n2" blocks starting at block "n1"
Deletes "n2" sequential blocks, starting at block "n1". After the deletion,
the Editor goes into insert mode where the first block (n1) was deleted.
Example of usage: RP,1046/80
Miscellaneous commands
There are several commands available to you with the Editor which do not fit
into any of the categories discussed so far. These commands cover a broad
range of capabilities. Some of them may prove useful to you while others may
not. They are presented below in alphabetical order.
Except for the Output command, each of these commands has only one format,
as follows:
A,"text" Append text to current line
Appends (adds) text to the end of the block at the pointer. The text will be
added to the immediate right of the last character in the block.
For example, let's move the pointer to block 327 and add a Y coordinate to it:
SCREEN DISPLAY REMARKS
---------------- ---------------
32.> F,327 The Find command
327. X0538 Block 327
327.> A,"Y07062" The Append command
327. X0538Y07062 Block 327 modified
CLR Buffer clear
This command clears the edit buffer of all text. It will completely erase
anything you are working on, so use it with caution.
When you type CLR and press the RETURN key, the following will display:
0.>
DONE Edit session complete
This command is used when you are through editing and want to save all your
work and leave the Editor.
If you did not specify an output file when you entered the Editor, the Editor
will assign the same filename as your input. Be aware that this will erase the
previous data in the file.
FP Front page (abort)
This is the Front Page command, which will allow you to abort the edit session,
exit the Editor, and return to whatever page of the system you came from. This
command is useful when you want to examine a file (search for text, etc), and
then quit the Editor without making any changes to the file.
When you type FP and press the RETURN key, the following message will display:
** Exit without saving changes (Y/N)?
Type Y (for yes) and press the RETURN key. FP erases the edit buffer and any
output file that might have been created, and returns to the page the system
was on when you entered the Editor.
If you want to save what you are working on, do not use this command. Instead,
use the DONE command, described above.
HELP Editor Help
This command will display instructions on how to use the editor commands.
You may not have this manual available, or you may just want a quick reminder
of how to use a command, or what commands are available.
When instructions display on the screen, the standard CNC-7 HELP mechanisms
are used. These are discussed elsewhere in this manual.
Using the HELP system will not affect the edit buffer. When you return to
the edit screen, the blocks that were displayed before using HELP will
display again. The pointer will also remain where it was.
O,n1,n2,"file" Output blocks "n1" through "n2"
This command is used to copy a portion of the edit buffer to an output device.
You specify the first and last blocks (n1 and n2) to be copied, and the
device and/or filename ("file"). This command is useful for saving portions
of your program that can be used at a later time in another program.
The output file may be any of the valid devices on the system, such
as paper tape, DNC, hard disk, floppy, or the Ethernet network, depending on
how your system is configured.
Example of usage: O,364,578,"SAVEPART1"
This will copy blocks 364 through 578 to a file called SAVEPART1.
O,n1/n2,"file" Output "n2" blocks starting at block "n1"
This output command operates the same as the output command above, except
that you specify the number of blocks (n2) to be copied, and the first of
these blocks (n1).
Example of usage: O,46/488,"SAVEPART2"
This will copy 488 blocks, starting at block 46 to a file called SAVEPART2.
Editor macros
There are times when an editing job can take a long time to complete. For
example, you make have a large program that requires editing of blocks
throughout the program. It may require that you use several edit commands,
each of which has to go through the file, one block at a time. Just imagine
typing several commands for each block in a file which contains hundreds or
even thousands of blocks.
This is where macros come into the picture. Macros are small programs which
automate a series of edit commands. You create the macro by typing edit
commands in the order you want them to be carried out. When you start the
macro running, you will be able to walk away from the CNC-7, and come back
later when the macro is finished editing.
Macros have limited use in the Editor, but are very powerful in Edit Convert
which is discussed later in this chapter. In the Editor, macros can be used
for the following types of operations:
o Swap the X and Y axes of part programs
o Convert Format 1 commands to Format 2
Macros are especially valuable when you have editing work to do throughout
your part program. With macros you can type the editing commands in any order,
as long as they don't interfere with the operation of the next editing
command.
Edit Convert provides you with all the macro features discussed in this
section, as well as much more powerful features not discussed here.
Creating macros
There are two kinds of macros:
o Internal edit session
o External file
Both of them are created in the Editor. You can create an internal macro
which will last only as long as your editing session, or you can create a
macro file and store it externally on a disk drive. They both work the same
way, but the one stored on the disk drive can be used at a later time to edit
another file. The internal macro is erased when you leave the Editor.
For all practical purposes, edit macros can be of any size. Memory is
allocated dynamically by the system, freeing you from concerns about
memory availability. Any of the Editor commands may be included in the macro,
except for the macro commands M, MA, MD, nM, and *M. Any commands which
produce messages are also not allowed.
External Macros:
An external macro is created by typing a series of editing commands and
storing them on the disk drive. The procedure is the same as you would
use for creating a part program. Enter the Editor from the Files and
Programs page and enter your own macro file name when asked for the
file name. Enter insert mode with the edit command "I", and type in
all of the edit commands required. When you are through, type DONE
followed by a RETURN to store the file. Only edit commands may be used
in this file.
If you already have a part program loaded into the editor, you can type
the editing commands in the insert mode, use the output command (O) to
save them on the disk drive, and then delete the inserted blocks from
the edit buffer.
Internal Macros:
When a macro is created with the MA command, discussed below, it cannot be
stored on a disk drive. It is for temporary use and can be used only while
you remain in the Editor. When you leave the Editor with the FP or DONE
command, the macro will be erased and cannot be restored.
Only one macro can exist in the editor at one time. If you create a second,
the first will be erased. If you are editing a file and load a macro file
from a disk drive, the internal macro will be erased.
Macro commands
There are five macro commands which are used to create, list, load,
and run your macros, as follows:
MA Create macro from keyboard
This command is used to create an internal macro after you have loaded a
file into the Editor for editing. Type MA and press the RETURN key. The
next block on the screen will begin with the prompt, as follows:
5.>MA
M:
The Editor is ready for you to type editing commands. When you type a
command and press the RETURN key, another M: prompt will appear below
the first.
When finished creating the macro, respond to the M: prompt by pressing the
RETURN key. The Editor returns to the command mode and the macro is
available whenever you wish to use it. You may use other edit commands
to edit the file in the edit buffer, without affecting the macro.
If you discover a mistake in the macro, you must retype the entire macro.
You cannot edit a block in the macro, unless the macro is stored on a disk
drive.
MA,"file" Load macro from disk file
This command is used to load a macro from a disk file. Once loaded, the
macro performs just as if it was typed from the keyboard, except that
you don't have to do the typing.
MD Display macro
This command is used to display your completed macro on the screen. You may
use this command in the command mode at anytime during a regular editing
session. When the listing is complete, the Editor displays a command mode
prompt.
M Execute macro one time only
This command starts running the macro and performing the edit commands within
the macro. After typing M, press the RETURN key.
Each command in the macro will be performed once, in the same sequence that
it appears in the macro. When the last edit command is completed, the macro
stops running and the Editor returns to command mode.
nM Execute macro "n" times
This command performs the macro as many times as you specify in place of "n".
The command edits your file in the same manner as the M command.
*M Execute macro repeatedly
This command edits your file in the same manner as the M command, performing
the macro repeatedly until it reaches the end of the file.
NOTE: While executing a macro the system will write the converted blocks of
the file out to the CRT. On very large files this can significantly slow down
the actual macro processing. The dilemma is that this output may be required
if you have to correct problems with the macro, but the output only slows you
down once the macro is shown to work.
To correct this, the editor macro processing allows you to "turn off" the
output to the CRT by using the control code CONTROL-O (not zero). This will
stop the macro from displaying any of the output, speeding up the macro
processing. A twirling status indicator is displayed while the macro runs.
If you wish to check on the progress of the macro, you can enter CONTROL-O
again to reenable the display, and then enter CONTROL-O again to silence it.
CONTROL-C can be used at any time during macro execution to terminate the
operation of the macro and return to the command line.
Examples of Editor Macro Usage
This section shows you how to create a macro and how to use it. We provide you
with several examples, but the possibilities are much more than we can show
you here. You will need to experiment on your own to discover the full
potential of the macro.
The examples show the prompts (M: or >) which appear on the screen. To the
right of the command is a description. This is included as an illustration only
and is not part of the command.
EXAMPLE NUMBER 1 - Creating and running an internal edit session macro to
convert part program Format One commands to Format Two. This example shows how
some of the commands can be converted.
5.> MA Create a temporary macro
M: C,"M70"M71" Convert Inch command
M: C,"M24"M01" Convert End of Pattern command
M: C,"M26"M02" Convert S&R offset command
M: C,"M27"M08" Convert End of S&R command
M: +1 Move to the next line
M: End of the macro
5.> MD Display the macro
C,"M70"M71"
C,"M24"M01"
C,"M26"M02"
C,"M27"M08"
+1
5.> T Go to the top of the file
Screen displays this message
0.> *M Start the macro running
The MA command is entered from the Editor command mode and puts the Editor into
the macro definition mode. You will be prompted with the characters M: instead
of the normal Editor prompt of >. At the prompt start typing the command. When
you have completed the command, press the RETURN key. Another M: prompt will
appear below the last.
When you have completed typing all commands, and another prompt appears, press
the RETURN key to exit the macro definition mode and return to the Editor
command mode. From here you can list the macro commands on the screen with
the MD command, and proofread them for accuracy.
Before you start the macro running, keep in mind that it will start from
wherever the pointer is located. If you want a macro to convert an entire file,
you must use the T command to move to the top of the buffer, as in the above
example.
The macro will perform the first command it finds, which converts any M70
characters in the first block to M71 characters. If M70 characters are not
found in the block, no conversion will take place. The macro then moves to
the next command and converts any M24 characters in the first record to M01
characters.
This process continues until the +1 command is encountered. This command tells
the Editor to move to the next block in the buffer and perform the above
commands all over again on that block. If there are no more blocks, move to
the next command, end the macro, and return to the Editor command mode.
EXAMPLE NUMBER 2 - Creating and running an internal edit session macro to
swap X and Y axes of a part program.
5.> MA Create a temporary macro
M: C,"X"Q" Rename all X's to Q's
M: C,"Y"X" Rename all Y's to X's
M: C,"Q"Y" Rename all Q's to Y's
M: +1 Move to the next line
M: End of the macro
5.> MD Display the macro
C,"X"Q"
C,"Y"X"
C,"Q"Y"
+1
5.> T Go to the top of the file
Screen displays this message
0.> *M Start the macro running
This macro performs exactly the same way as the previous example, except that
it edits different characters. Swapping X and Y axes requires an extra step of
converting the X's to Q's (or you could convert Y's to Q's). This is done
because if you convert the X directly to a Y, the next command will convert
the Y to an X. All of your XY coordinates will become XX coordinates and the
part program will be useless.
The first command changes all X's to Q's. If a block looked like X046Y116 it
will now look like Q046Y116. The next command will change all Y's to X's, and
the block will now look like Q046X116. Lastly, the Q's will be changed to Y's,
and the block will now look like Y046X116. The X and Y axes have now been
swapped.
EXAMPLE NUMBER 3 - Creating and running an external edit session macro to
swap X and Y axes of a part program. This example shows you how to create a
macro in the Editor, store it to disk, load your part program into the
Editor, and run the Macro.
EP,XYSWAP Enter the Editor with a blank screen
and create a file called XYSWAP for
storing your macro.
Screen displays this message
1. C,"X"Q" Rename all X's to Q's
2. C,"Y"X" Rename all Y's to X's
3. C,"Q"Y" Rename all Q's to Y's
4. +1 Move to the next line
5. End of the macro
5.> T Go to the top of the file
Screen displays this message
0.> L Display the macro on the screen
1. C,"X"Q"
2. C,"Y"X"
3. C,"Q"Y"
4. +1
5.> DONE Exit the Editor and store the macro
EP,PARTFILE Enter the Editor using a part
program file called PARTFILE
0.> T Go to the top of the file
Screen displays this message
0.> MA,"XYSWAP" Load the macro into the Editor
0.> *M Start the macro running
5.> DONE Exit the Editor and store the macro
The above method takes longer to create than would an internal session macro.
However, once it is created and stored, it does not have to be created again.
If you are converting several part programs, or if the conversion macros you
create are used often, the external macro can be a great time saver. With just
two commands you can load and run the macro:
MA,"XYSWAP"
*M
Edit Convert
Edit Convert is an expanded form of the Editor which provides you with the
following capabilities:
o All the features of the Editor
o Expanded set of commands
Edit Convert works the same as the Editor in most respects: File selection,
edit buffer usage, typing rules, Editor commands, etc. But it does not work the
other way around, Edit Convert commands will not work in the Editor.
This section provides you with a discussion of Edit Convert and its expanded
set of commands. The discussion includes:
o Starting and ending Edit Convert sessions
o The purpose of each command
o Using edit macros to save you time
o Modifying files
Entering Edit Convert
Entering Edit Convert is almost the same as entering the Editor. You can enter
it from any page displayed on the screen (if you use keyboard commands), or you
may use the "Edit Convert" button located on the File Utilities page. Use
"Edit" to enter the Editor, or "Edit Convert" to enter Edit Convert.
The Edit Convert keyboard command is "EC,filename".
After entering the Edit Convert command either from the keyboard or from the
touchscreen, a series of setup questions will be displayed on the screen. These
questions ask you to supply information needed by Edit Convert about your file,
which the system needs, but cannot figure out for itself. The screen display
will look like the following:
Format (1/2)?
Input File:
1=Inch 2=Metric (1/2)?
1=Leading zeros 2=Trailing zeros (1/2)?
1=Incremental 2=Absolute (1/2)?
Output file:
Same as input file (Y/N)?
1=Inch 2=Metric (1/2)?
1=000.000 2=0000.00 3=000.00 (1/2/3)?
1=Leading zeros 2=Trailing zeros (1/2)?
1=Incremental 2=Absolute (1/2)?
Above entries correct (Y/N)?
Each question is presented in multiple choice form. The possible answers are
displayed in parenthesis, e.g.: (1/2). The cursor first appears next to the
INCH/METRIC question under INPUT FILE. There are two acceptable answers for this
question, 1 or 2. Type a 1 or 2 and press the RETURN key. The cursor will move to
the next question.
If you type a number other than the possibilities listed, the computer will ask
the same question again and again until you enter a correct response.
The first question under OUTPUT FILE asks you if the output file format is to
be the same as the input file format. If you want the coordinates of the input
and output files to be in the exact same format, answer Y for YES. The computer
will skip the next four questions because they are not needed.
The last question on the screen is your safety check in case you typed the wrong
answer to one of the previous questions. If you type N and press the RETURN key,
the computer will erase all of your answers and go through the questions again.
If you type Y and press the RETURN key, the computer will begin reading your
input file into the edit buffer. As with the Editor, no changes to the file
occur at this point, the file is merely read in. After reading, the first 18
lines of the file will be displayed on the screen. The file is now ready for
editing with Editor or Edit Convert commands or macros.
Edit Convert commands
There are seven commands unique to Edit Convert. Each of them completely supports
Excellon formats 1 and 2. These seven commands are as follows:
o AD - Add offset
o CV - Convert
o GD - Grid
o IO - Incremental offset
o N+ - Add or delete sequence numbers
o SC - Scale
o SW - Swap Axis
These commands can be used only in Edit Convert. They will not be recognized
by the Editor, NC mode, or Maintenance mode. In addition to these seven
commands, all of the Editor commands are available to you, as well as the macro
capability. This section will not discuss the Editor commands, because they are
described earlier in this chapter. However, you will see examples of how to
use Edit Convert commands in macros.
All the seven Edit Convert commands, except for CV, have parameters that you can
specify with the command. The CV command has no parameters. Instead, it refers
back to the options you specified when you entered Edit Convert and answered the
setup questions.
The Add offset, Grid, and Scale commands will work only with the output file
format you specified when entering Edit Convert. This is the selected Excellon
format (1 or 2).
All of the Edit Convert commands are capable of working on only one block at a
time. This block is called the current block, or pointer block. There are no
options that allow multiple blocks the way that Editor commands do. There is a
good reason for this. These conversion commands are most often used in macros,
and the macro command allows you to process multiple blocks, specifying how
many blocks are to be worked on. Macros are discussed earlier in this chapter,
and Edit Convert macro examples are given later in this chapter.
The details of the seven commands are as follows:
AD,X#Y# Add Offset
Add offset
AD,X#Y#
This command adds an offset to the coordinate in the output file format. You
specify the offset in place of # for either X or Y, or both. If you specify an
offset for only X or Y, the computer will assume that there is no offset to be
added for the other.
Offsets will be entered in the output format (leading zero or trailing zero,
Inch/Metric) that you specified upon entering Edit Convert. Decimal points are
accepted.
This command can be used to drill the PC board in a different location on the
panel to make better use of the material, to move part or all of the pattern,
or to correct a mistake that placed the board in the wrong location on the panel.
Example of usage: AD,X015Y01
In INCH mode, this command adds 1.5 inch to all X coordinates, and 1.0 inch
to all Y coordinates.
This will change the following block
from: X02Y03
to: X035Y04
CV Convert
Convert input to output format
CV
This command converts the current block into the output format you specified when
entering Edit Convert. This conversion process includes leading and training
zeros, Inch/Metric, Absolute and Incremental.
The CV command must be used before the Add offset, Grid, and Scale commands. These
commands perform arithmetic operations on Excellon format (output format) only.
Example of usage: CV
Input file is Metric with trailing zero, output file is to be Inch with leading
zero. CV will convert the block
from: X1514Y2579
to: X005961Y001016
GD,# Grid
Grid
GD,#
This command rounds off the X and Y values of the coordinate to the nearest grid
value. You specify the grid spacing in place of #. The spacing may be expressed
as a value or a fraction (e.g.: 0.3333 and 1/3 are roughly equivalent).
The grid is established at work zero. If you want to establish the grid elsewhere,
set the grid at work zero and then add an offset with the AD command.
This command can be used to eliminate spurious extra digits on the coordinates
which may be created during the process of digitizing a pattern. This can be
especially valuable when the entire pattern is known to be "on grid".
Example of usage: GD,1/4 or GD,0.25
Either of these two commands will round off the coordinate to the nearest
quarter inch as follows:
from: X01013Y912475
to: X01Y0125
IO(,X#Y#) Incremental offset
Incremental offset
IO,X#Y#
This command is used when you are converting incremental part program coordinates
to absolute, or vice versa. IO allows you to specify the starting value for the
incremental offset accumulator, or to display its current value. The incremental
offset accumulator is set to zero when you enter Edit Convert.
IO with no parameter allows you to display the current value of the incremental
offset as follows:
IO followed by an XY coordinate allows you to preset the incremental offset
so that you can control the conversion of the first block from incremental to
absolute or the other way around.
When converting to absolute from incremental, each coordinate generated will be
equal to the previous value of the incremental offset plus the incremental input
coordinate, and then the generated value is loaded back into the incremental
offset.
When converting to incremental from absolute, each coordinate generated will be
equal to the absolute input coordinate minus the previous value of the incremental
offset. The absolute coordinate is then loaded into the incremental offset.
N+ or N- Sequence numbers
Sequence numbers
N+ or N-
Part programs for Excellon machines do not need sequence numbers (block numbers).
The Editor adds sequence numbers to a file only when the file is in the Editor.
When the file is stored, the sequence numbers are not stored with the file.
But this is not the way it has always been. In earlier days of NC drilling, part
programs could have sequence numbers permanently assigned to each block. Some
users still prefer to use sequence numbers, which are supported by all Excellon
controls. The N+ command is used to add sequence numbers to a file. On the other
hand, if the part program has sequence numbers, and you don't want them, the N-
command removes them.
Sequence numbers start from 0001. Each block is given the next highest sequence
number. If a file contains more than 9999 blocks, Edit Convert will number the
10,001st block as 0001, the 10,002nd as 0002, etc. This means that you will have
to use some care in editing large files, because you might have duplicate
N-type sequence numbers in different parts of the file.
As soon as you type N+ or N-, Edit Convert immediately adds or removes sequence
numbers from each block as it converts the file.
SC,X#Y# Scale coordinates
Scaling coordinates
SC,X#Y#
Sometimes when PC board prints are digitized into XY coordinates, the prints are
not to scale. Prints are often made to a larger scale to make them easier to read.
If the scale is not adjusted when the digitizing is done, then the created PC
board will also be too big.
The Scale coordinates command will correct the coordinates to the correct scale.
If you know what scale was involved, you can supply the scale values (factors)
in place of # for either or both of the X and Y axes. As each coordinate is
converted, the new coordinate is displayed on the screen. It is possible that
the X and Y coordinates could each be to a different scale.
As the coordinates are converted, the X coordinate is divided by the value you
supply for X#, and the Y coordinate is divided by the value you supply for Y#.
For example, if the coordinates were digitized at twice the size of the actual
PC board, use a value of two. The coordinate will be divided by two and the new
coordinate created by Edit Convert will be to the correct scale.
The range of acceptable scale factors is from 0.0010 to 30.0000 in increments
of 0.0001.
The Scale coordinates command will scale down all drilling and routing
coordinates and dimensions. This includes all X and Y coordinates, as well
as the routing commands I, J, and A.
SW,X+Y+ Swap axis
Swap axis
SW,X#Y#
Under the subject of Editor Macros was an example of how to use the Change
command to swap the X and Y axis in a part program. The Swap axis command does
the same job, but is more powerful and flexible than the Change command.
The Swap axis command will swap + and/or - signs to create mirror images.
In Excellon format, the I and J values in routing do not have to be swapped.
You do have to supply the + and - signs to indicate how you want the output
file to appear.
Edit Convert will swap the position of the X and Y axes, but leave the coordinate
value in place. For example, if you type SW,Y+X+, a block will be changed
from: X4467Y3162
to: X3162Y4467
If signs are being changed, they are changed first before the X and Y swap occurs.
As soon as the swap is complete, the new coordinate will be displayed on the
screen.
Edit Convert macros
Edit Convert macros operate the same as Edit macros. You can use internal or
external macros, and you can create and run them in the same way as with the
Editor. The big difference is the commands which can be used in Edit Convert vs
the Editor. The Editor will not run Edit Convert commands, but Edit Convert will
run the commands used in the Editor. This makes Edit Convert much more powerful.
Examples of Edit Convert macro usage:
The section on Editor macros shows you how to create a macro and how to use it.
We will not duplicate that information here but we do provide you with examples
of Edit Convert macros. As with Editor macros, the possibilities are much more
than we can show you here. You will need to experiment on your own to discover
the full potential of the macro as it applies to your application.
The examples show the prompts (M: or >) which appear on the screen. To the right
of the command is a description. This is included as an illustration only and is
not part of the command.
Example No. 1 - Creating and running an internal Edit Convert macro to swap the
X and Y axes and add sequence numbers.
>MA Create a temporary macro
M:SW,Y+X+ Swap axes
M:N+ Add sequence numbers
M:+1 Go to next line
M: End of the macro
>MD Display the macro
SW,Y+X+
N+
+1
>T Top of the file
>*M Start the macro running
Example No. 2 - Creating and running an internal Edit Convert macro to convert
Inch to Metric, remove sequence numbers, and scale the Y axis. It is assumed
that the setup questions are answered to set up for input in Inch, and Output
in Metric.
>MA Create a temporary macro
M:CV Convert to output format
M:N- Remove sequence numbers
M:SC,X1.0Y1.001 Scale the Y axis
M:+1 Go to next line
M: End of the macro
>MD Display the macro
CV
N-
SC,X1.0Y1.001
+1
>T Top of the file
>*M Start the macro running
|