Reference Guide

PMAC Quick Reference Guide
Programming PMAC 33
For I-Variables with limited range, an attempt to assign an out-of-range value does not cause an error.
The value is rolled over automatically to within the range by modulo arithmetic (truncation). For
example, I3 has a range of 0 to 3 (4 possible values). The command I3=5 would actually assign a value
of 5 modulo 4 = 1 to the variable.
On PMACs with battery-backed RAM, most of the I-Variable values can be stored in a 2K x 8 EEPROM
IC with the SAVE command. These values are safe here even in the event of a battery-backed RAM
failure, so the basic setup of the board is not lost. After a new value is given to one of these I-Variables,
the SAVE command must be issued in order for this value to survive a power-down or reset.
The I-Variables that are not saved to EEPROM are held in battery-backed RAM. These variables do not
require a SAVE command to be held through a power-down or reset, and the previous value is not
retained anywhere. These variables are: I19-I44, Ix13, Ix14.
On PMACs with flash memory backup (those with Option 4A, 5A, or 5B), all of the I-Variable values can
be stored in the flash memory with the SAVE command. If there is an EEPROM IC on the board, it is not
used. After a new value is given to any I-Variable, the SAVE command must be issued in order for this
value to survive a power-down or reset.
Default values for all I-Variables are contained in the manufacturer-supplied firmware. They can be used
individually with the I{constant}=* command, or in a range with the I{constant}..
{constant}=* command. Upon board re-initialization by the $$$*** command or by a reset with
E51 in the non-default setting, all default settings are copied from the firmware into active memory. The
last saved values are not lost; they are just not used.
P-Variables
P-Variables are general-purpose user variables. They are 48-bit floating-point variables at fixed locations
in PMAC’s memory, but with no pre-defined use. There are 1024 P-Variables, from P0 to P1023. A
given P-Variable means the same thing from any context within the card; all coordinate systems have
access to all P-Variables (contrast Q-Variables, which are coupled to a given coordinate system). This
allows for useful information passing between different coordinate systems. P-Variables can be used in
programs for any purpose desired: positions, distances, velocities, times, modes, angles, intermediate
calculations, etc.
If a command consisting simply of a constant value is sent to PMAC, PMAC assigns that value to
variable P0. For example, if the command 342<CR> is sent to PMAC, it will interpret it as
P0=342<CR>. This capability is intended to facilitate simple operator terminal interfaces. It does mean,
however, that it is not a good idea to use P0 for other purposes, because it is easy to change this
accidentally.
Q-Variables
Q-Variables, like P-Variables, are general-purpose user variables: 48-bit floating-point variables at fixed
locations in memory, with no pre-defined use. However, the meaning of a given Q-Variable (and hence
the value contained in it) is dependent on which coordinate system is utilizing it. This allows several
coordinate systems to use the same program (for instance, containing the line X(Q1+25) Y(Q2), but to do
have different values in their own Q-Variables (which in this case, means different destination points).
Several Q-variables have special uses. The ATAN2 (two-argument arctangent) function uses Q0
automatically as its second argument (the cosine argument). The READ command places the values it
reads following letters A through Z in Q101 to Q126, respectively, and a mask word denoting which
variables have been read in Q100. The S (spindle) statement in a motion program places the value
following it into Q127.
Based on that and since a total of 1024 Q-Variables are shared between potentially eight Coordinate
Systems (128 variables each), the practical range of the Q-Variables to be used safely in motion programs
is therefore Q1 to Q99.