User's Manual

PMAC User Manual
Writing Programs for PMAC 211
M30 — End of Program with Rewind
See M02 description. M30 will be essentially equivalent to M02 in most systems but will return to the
beginning of the program.
Default Conditions
Typically, a machine running G-code style programs requires many default values and modes beyond
what PMAC sets automatically during its power-up/reset cycle. To set these defaults, it is best to use the
PLC 1 program, which will be the first thing executed after the automatic power-up/reset cycle
(effectively extending what is done in this cycle). The last line in this program should be DISABLE PLC
1, which prevents repeated execution of the program. A simple file for such a program could be:
CLOSE
OPEN PLC 1
CLEAR
M55=0 ; Spindle Off
P92=3000 ; Maximum spindle RPM
P95=1000 ; Max spindle accel in RPM/sec
M70=0 ; English measurements
DISABLE PLC 1 ; So this is only executed once
CLOSE
Rotary Motion Program Buffers
The rotary motion program buffers allow for the downloading of program lines during the execution of
the program and for the overwriting of already executed program lines. This permits continuous
execution of programs larger than the PMAC memory space, and also real-time downloading of program
lines (equivalent to SMCC’s MDI mode).
Defining a Rotary Buffer
Each coordinate system can have a rotary program buffer. To create a rotary buffer for a coordinate
system, address that coordinate system (&n) and send the DEFINE ROT {constant} command,
where {constant} is the size of the buffer in memory words. Each value in a program (e.g. X1250)
takes one word of memory. The buffer should be sized to allow enough room for the distance ahead of
the execution point you wish to load. Since most applications utilizing rotary buffers will not strain the
PMAC memory requirements, it is a good idea to oversize the buffer by a good margin.
For instance, to load 100 program lines ahead of the execution point in a four-axis application where it is
using constant values for position (e.g. X1000 Y1200 Z1400 A1600), there should be at least 400
words of memory in the buffer, so it would be a good idea to allot 500 or 600 words for the rotary buffer
(e.g. DEFINE ROT 600).
Required Buffer State for Defining:
In order for PMAC to be able to reserve room for the rotary buffer, there can be no data-gathering buffer
and no rotary program buffer for a higher-numbered coordinate system at the time of the DEFINE ROT
command. Therefore, delete any data-gathering buffer first, and define the rotary buffers from high-
numbered to low-numbered. For instance:
DELETE GATHER
&3 DEFINE ROT 200
&2 DEFINE ROT 1000
&1 DEFINE ROT 20