User's Manual

PMAC User Manual
Computational Features 153
Special-Use Q-Variables
Several Q-variables have special uses that need to be watched. The ATAN2 (two-argument arctangent)
function uses Q0 as its second argument (the cosine argument) automatically. 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.
M-Variables
To permit easy access to the PMAC memory and I/O space, M-variables are provided. Generally, a
definition only needs to be made once, with an on-line command. On PMACs with battery backup, the
definition is held automatically. On PMACs with flash backup, the SAVE command must be used to
retain the definition through a power-down or reset.
Define an M- variable by assigning it to a location, and define the size and format of the value in this
location. An M-variable can be a bit, a nibble (four bits), a byte (eight bits), 1-1/2 bytes (12 bits), a
double-byte (16 bits), 2-1/2 bytes (20 bits), a 24-bit word, a 48-bit fixed-point double word, a 48-bit
floating-point double word, or special formats for dual-ported RAM and for the thumbwheel multiplexer
port.
There are 1024 M- variables (M0 to M1023), and as with other variable types, the number of the M-
variable may be specified with either a constant or an expression: M576 or M(P1+20) when read from;
the number must be specified by a constant when written to.
M-Variable Definitions.
The definition of an M-variable is done using the defines-arrow (->) composed of the minus-sign and
greater-than symbols. Generally, a definition only needs to be made once, with in an on-line command,
because it is stored in battery-backed RAM or saved to flash memory. The M-variable thus defined may
be used repeatedly.
An M-variable may take one of the following types, as specified by the address prefix in the definition:
X: 1 to 24 bits fixed-point in X-memory
Y: 1 to 24 bits fixed-point in Y-memory
D: 48 bits fixed-point across both X- and Y-memory
L: 48 bits floating-point across both X- and Y-memory
DP: 32 bits fixed-point (low 16 bits of X and Y) (for use in dual-ported RAM
F: 32 bits floating-point (low 16 bits of X and Y) (for use in dual-ported RAM
TWD: Multiplexed BCD decoding from Thumbwheel port
TWB: Multiplexed binary decoding from Thumbwheel port
TWS: Multiplexed serial I/O decoding from Thumbwheel port
TWR: Multiplexed serial resolver decoding from Thumbwheel port
*:
No address definition; uses part of the definition word as general-purpose variable
If an X or Y type of M-variable is defined, also define the starting bit to use, the number of bits, and the
format (decoding method).
Typical M-variable definition statements are:
M1->Y:$FFC2,8,1
M102->Y:49155,8,16,S
M103->X:$C003,0,24,S
M161->D:$002B
M191->L:$0822
M50->DP:$D201
M51->F:$D7FF
M100->TWD:4,0.8.3,U