User's Manual

PMAC User Manual
Computational Features 149
$0000
$00FF
$0100
$17FF
$1800
$BBFF
$BC00
$BFFF
$C000
$C03F
$D000
$DFFF
$E000
$F000
$FFFF
Internal DSP
Memory
DSP-Gate
Registers
Dual-Ported
RAM
VME bus
registers
I/O
Registers
External
Static
RAM
(Battery
Backed)
X-Memory Y-Memory
823 16 15 7 0 23 16 15 8 7 0
Fixed-Use Calculation Registers
User Buffer Storage Space
User-Written Servo Storage M-Variable Definitions
Mailbox Registers
VME Setup Registers
Figure 25 PMAC Memory Mapping
P-Variables
P-variables are general-purpose user variables. They are 48-bit floating-point variables at fixed locations
in the PMAC 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.
Array Capabilities
Array Reading
It is possible to use a set of P-variables as an array. To do this when reading from the variables is easy:
Simply replace the constant specifying the variable number with an expression in parentheses — use the
({expression}) syntax instead of the P{constant} syntax. PMAC simply treats this syntax as a
type of function call, like SIN({expression}).
Example:
To move in sequence to the positions specified by P101 to P200, you could use a program segment like
the following:
F10
P1=101 ; Array index variable
WHILE (P1<201) ; Start loop
X(P(P1)) ; As P1 changes, the destination position changes
DWELL100
P1=P1+1 ; Increment the index
ENDWHILE