User's Manual

PMAC User Manual
Writing Programs for PMAC 203
Pointing to the Program
Pointing to the program is done with the B{constant} command, where the {constant} represents
the number of the motion program buffer. Use the B command to change motion programs, and after any
motion program buffer has been opened. Do not use it if repeatedly running the same motion program
without modification. When PMAC finishes executing a motion program, the program counter for the
coordinate system is set automatically to point to the beginning of that program, ready to run it again.
Use the PC (program counter) command to see which program the coordinate system is pointing to at the
time. A response is received something like P5:0, which means that the coordinate system is pointing to
motion program 5, at the top (address offset of 0).
Running the Program
Once pointing to the motion program to run, issue the command to start execution of the program. For
continuous execution of the program, use the R command (<CTRL-R> for all coordinate systems
simultaneously), or take the START/ line on the JPAN connector low with the coordinate system selected
on the FPDn/ lines of the same connector. The program will execute all the way through unless stopped
by command or error condition.
Stepping the Program
To execute just one move, or a small section of the program, use the S command (<CTRL-S> for all
coordinate systems simultaneously), or take the STEP/ line on the JPAN connector low with the
coordinate system selected on the FPDn/ lines of the same connector. The program will execute to the
first move DWELL, or DELAY, or if it first encounters a BLOCKSTART command, it will execute to the
BLOCKSTOP command.
What PMAC Checks For
When a run or step command is issued, PMAC checks the coordinate system to make sure it is in proper
working order. If it finds that something in the coordinate system is not set up properly, it will reject the
command, sending a <BELL> command back to the host. If I6 is set to 1 or 3, it will report an error
number as well telling the reason the command was rejected.
PMAC will reject a run or step command for any of the following reasons:
A motor in the coordinate system has both overtravel limits tripped (ERR010)
A motor in the coordinate system is currently executing a move (ERR011)
A motor in the coordinate system is not in closed-loop control (ERR012)
A motor in the coordinate system in not activated {Ix00=0} (ERR013)
There are no motors assigned to the coordinate system (ERR014)
A fixed (non-rotary) motion program buffer is open (ERR015)
No motion program has been pointed to (ERR016)
After a / or \ stop command, a motor in the coordinate system is not at the stop point (ERR017)
Implementing a Machine-Tool Style Program
PMAC permits the execution of machine-tool style RS-274 (G-Code) programs by treating G, M, T, and
D codes as subroutine calls. This permits the machine tool manufacturer to customize the codes for their
own machine, but it requires the manufacturer to do the actual implementation of the subroutines that will
execute the desired actions. Many of the codes are quite standard, and Delta Tau has provided examples
of these. This section discusses subtler issues involved in implementing the codes.