Reference Guide

PMAC Quick Reference Guide
Programming PMAC 31
PROGRAMMING PMAC
Programming PMAC is very simple; the ease of use and power is based in the following features:
A clever interrupt-driven scheme allows every task, each motion program and PLC, to run
independently of each other.
Pointer M-Variables allow monitoring virtually any register in PMAC’s memory from different
sources: motion programs, PLCs or the host computer.
Communications are activated continuously. At any moment, any variable or status command could
be interrogated.
Up to eight Axes can be either synchronized together, controlled individually or in any combination
in between.
Data gathering and reporting functions allows saving data such as motion trajectories, velocity
profiles or any set of variables for later analysis and plot.
PMAC is fundamentally a command-driven device. PMAC performs by issuing it ASCII command text
strings and generally, PMAC provides information to the host in ASCII text strings.
When PMAC receives an alphanumeric text character over one of its ports, it does nothing but place the
character in its command queue. It requires a control character (ASCII value 1 to 31) to cause it to take
action. The most common control character used is the carriage return (<CR>; ASCII value 13), which
tells PMAC to interpret the preceding set of alphanumeric characters as a command and to take the
appropriate action.
Online Commands
Many of the commands given to PMAC are on-line commands; that is, they are executed immediately by
PMAC to cause some action, change some variable, or report some information back to the host.
Some commands, such as P1=1, are executed immediately if there is no open program buffer, but are
stored in the buffer if one is open. Other commands, such as X1000 Y1000, cannot be on-line
commands; there must be an open buffer – even if it is a special buffer for immediate execution. These
commands will be rejected by PMAC (reporting an ERR005 if I6 is set to 1 or 3) if there is no buffer
open. Still other commands, such as J+, are on-line commands only and cannot be entered into a
program buffer (unless in the form of CMD"J+", for instance).
There are three basic classes of on-line commands:
1. Motor-specific commands, which affect only the motor that is currently addressed by the host
2. Coordinate-system-specific commands, which affect only the coordinate system that is currently
addressed by the host
3. Global commands, which affect the card regardless of any addressing modes.
A motor is addressed by a #n command, where n is the number of the motor, with a range of 1 to 8,
inclusive. This motor is the one addressed until another #n is received by the card. For instance, the
command line #1J+#2J- tells Motor 1 to jog in the positive direction, and Motor 2 to jog in the
negative direction. There are only a few types of motor-specific commands. These include the jogging
commands, a homing command, an open loop command, and requests for motor position, velocity,
following error, and status.