User's Manual

PMAC User Manual
210 Writing Programs for PMAC
This assumes, of course, that motor #4 on PMAC is the spindle motor and that the counting-up direction
is clockwise. Spindle speed will have been determined already in other routines by setting I422 (motor #4
jog speed).
If PMAC were controlling the spindle with an open loop voltage, these routines would put a voltage on an
otherwise-unused analog output by writing to a DAC register. For example:
N03000 M402=P97*P9
RET
N04000 M402=-P97*P9
RET
N05000 M402=0
This sample assumes M402 is assigned to the DAC4 register (Y:$C00A,8,16,S), P97 is the desired
spindle speed in RPM, and P9 is the scale factor relating RPM to DAC bits (3,276.7 DAC bits/volt).
If fancier tasks such as constant surface speed are desired, a separate motion program for the spindle will
be required. If these M-codes were to interface with this example, they would be:
N03000 M55=1 ; Flag for clockwise spindle
CMD "&2B1010R" ; Start the spindle program
RET
N04000 M55=-1 ; Flag for counterclockwise spindle
CMD "&2B1010R" ; Start the spindle program
RET
N05000 M55=0 ; Flag for spindle off
RET ;
M07 — Low-Level (Mist) Coolant On
M08 — High-Level (Flood) Coolant On
M09 — Coolant Off
The actual implementation of these M-codes will be machine dependent, but typically it will be simple.
For instance, if the coolant on/off control were wired into the PMAC Machine Output 7, and the coolant
high/low control were wired into the PMAC Machine Output 8, the routines could simply be:
N07000 M7=1 ; Set Mach. Out. 7: Coolant On
M8=0 ; Clear Mach. Out. 8: Low Level
RET
N08000 M7=1 ; Set Mach. Out. 7: Coolant On
M8=1 ; Set Mach. Out. 8: High Level
RET
N09000 M7=0 ; Clear Mach. Out. 7: Coolant Off
RET
DWELL statements could be added before and/or after the setting of the outputs if it is desired to provide
some time for the change to occur.
M12 — Chip Conveyor On
M13 — Chip Conveyor Off
The implementation of these codes will be machine dependent, but typically very simple. For instance, if
the conveyor on/off line were wired into Machine Output 2, these routines could simply be:
N12000 M2=1 ; Set Mach. Out. 2: Conveyor On
RET
N13000 M2=0 ; Clear Mach. Out. 2: Conveyor Off
RET