User's Manual

PMAC User Manual
20 Getting Started with PMAC
When finished entering the program, type CLOSE <CR> to exit the program buffer. To enter a new
program in the place of the one in the buffer, open the buffer, type CLEAR, and enter the new program. An
example follows:
OPEN PROG 1
CLEAR ; erase old program
F2.36 ; 2.36 in/sec
X5.346 Y0 ; first side of square
X5.346 Y5.346 ; second side
X0 Y5.346 ; third side
X0 Y0
; fourth side
CLOSE
Using the Program Editor
It is easiest to type programs using the program editor in the PC Executive (terminal) Program. Here the
program can be changed at will, and then it can be downloaded to the card by selecting the Download
Editor to PMAC menu option, or by hitting <ALT-D> when the editor screen is displayed. Include in each
program space the lines to open the buffer, to clear out the old program, and to close the buffer at the end.
Executing a Motion Program
Starting the Program
With a program held in PMAC buffer, it is easy to run. To run program 1, make sure the coordinate system
to run the program is addressed (&1 in this case), type B1<CR> (point to beginning of program 1), then
type R<CR>. The B command with a number makes the specified program the working (operative)
program for the coordinate system. The R command will start execution of the program.
Stopping the Program
There are several ways to stop a running program. Q<CR> (Quit) stops the program at the end of the
presently executing move. A<CR> (Abort) causes the motors in the coordinate system to start decelerating
immediately. Both of these commands leave the program ready to execute (run or step) the next line in the
program. To re-start the program at the beginning, type B<CR> (the B command without a number operates
on the current working program). This resets the program counter to the top (completion of a program
automatically resets the counter to the top).
Remember that the motor velocity and acceleration limits (Ix16 and Ix17) are in effect for all motors in the
coordinate system. If a motor is asked to exceed one of these limits, all motors in the coordinate system are
slowed to honor the limit. If the programmed moves seem slower than what as expected, this could be the
cause.
Refining the Program
Few times will the program work exactly right the first time. Go through an iterative process of editing,
downloading, executing, and evaluating. This is one of the key reasons for using the program editor. The
required changes can be made in the editor without re-typing the entire program. Then, the entire revised
program can be downloaded to PMAC. This process is why it is a good idea to have the CLEAR command
immediately after the OPEN command: it erases the old version in PMAC so the new version can replace it.
There is no reason in this process to upload the program from PMAC. The program editor maintains its
copy even after the download, and it keeps comments with it. The only reasons to upload a program are to
confirm that it is downloaded properly, and to restore a program that was lost by the host computer.