User's Manual

Turbo PMAC User Manual
Turbo PMAC Computational Features 245
When accessing a Q-variable from a motion program statement (including kinematic subroutines), the Q-
variable belonging to the coordinate system running the program is being used. If a different coordinate
system runs the same motion program, it will use different Q-variables.
When accessing a Q-variable from a PLC program statement, the Q-variable for the coordinate system
that has been addressed by that PLC program with the ADDRESS command is being used. Each PLC
program can address a particular coordinate system independent of other PLC programs and independent
of the host addressing. If no ADDRESS command is used in the PLC program, the program uses the Q-
variables for C.S. 1.
Type of Memory Used
Q-variables can be located in either the main memory or in the supplemental battery-backed parameter
memory (if Option 16 is ordered). If I46 is set to 0 (default) or 1, the Q-variables are located in the main
memory, which has fast access (1 wait state) but whose values are not retained without a SAVE command
copying the values to flash memory. On power-up/reset, the last saved values are copied from flash
memory into the active variable registers in RAM.
If I46 is set to 2 or 3, the Q-variables are located in the Option 16 battery-backed RAM, which has slow
access (9 wait states) but whose values are retained by the battery automatically when power is removed.
Special-Use Q-Variables
Several Q-variables have special uses to watch for. The ATAN2 (two-argument arctangent) function
automatically uses Q0 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.
If the application uses kinematic subroutines to convert between tool-tip (axis) positions and joint (motor)
positions, variables Q1 – Q10 and possibly Q11 – Q19 for the coordinate system are used for the axis data
in these subroutines (Q1 – Q9 are for axis positions; Q10 tells whether PVT moves are being converted; if
PVT moves are converted, Q11 – Q19 are for axis velocities). If using the kinematic subroutines, make
sure not to use the Q-variables employed in the subroutines for any other purpose.
M-Variables
M-variables are provided to permit easy user access to Turbo PMAC’s memory and I/O space. Generally,
a definition only needs to be made once, with an on-line command. 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 defining the size and format of the value in this location. An M-variable can be a bit, a nibble (4
bits), a byte (8 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 JTHW multiplexer port.
There are 8192 M-variables (M0 to M8191), 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).
M-Variable Definitions
The definition of an M-variable is done using the defines-arrow (->) composed of the minus sign and
greater than symbol. Generally, a definition needs to be made only 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