User's Manual

Turbo PMAC User Manual
48 Talking to Turbo PMAC
Buffered (Program) Commands
As their name implies, buffered commands are not acted on immediately, but held for later execution.
Sending a buffered program command to Turbo PMAC merely cause the command to be loaded into the
open program buffer; the command will not actually be executed until that program is run.
Turbo PMAC has many program buffers – 224 regular motion program buffers, 16 rotary motion
program buffers (1 for each coordinate system), 16 forward-kinematic subroutine buffers (1 for each
coordinate system), 16 inverse-kinematic subroutine buffers (1 for each coordinate system), and 32
uncompiled PLC program buffers. (Buffers for compiled or assembled programs – compiled PLCs, user-
written servo algorithms, and user-written phase algorithms – do not take text commands; instead they
take DSP machine code.)
Before commands can be entered into a buffer, that buffer must be opened (e.g. OPEN PROG 3, OPEN
PLC 7, &1 OPEN FORWARD). Note that buffered commands can only be entered into the buffer
through the same port that issued the OPEN command. Only one port at a time may have an open
program buffer.
Each program command is added onto the end of the list of commands in the open buffer; if you wish to
replace the existing buffer, use the CLEAR command immediately after opening to erase the existing
contents before entering the new ones. After finishing entering the program statements, use the CLOSE
command to close the opened buffer.
The rotary motion program buffer for a coordinate system is a special program buffer that can execute
motion programs at the same time it is open for entry of program commands from the host computer. If
an open rotary program buffer is executing, but has already executed every command sent to it, it will
execute the next buffered program command sent to it almost immediately.
Note that certain commands will be treated as on-line commands if no buffer is open on the port over
which it is sent, or as buffered program commands if a buffer is open on this port. For example, the
command P1=1 will be executed immediately if no buffer is open on the port, but it will be entered into a
program buffer for later execution as part of the program if a buffer is open on the port. Some of these
commands will have completely different meanings if a buffer is open on the port or if it is not. The
command M10 is a query for the value of variable M10 if no buffer is open on the port; it is a call to an
M-code subroutine if a motion program buffer is open on the port.