User`s manual

4.0 - Programming PMAC
Page - 32
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, you must 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
The M-variable definitions are stored as 24-bit codes at PMAC addresses Y:$BC00 (for M0) to Y:$BFFF (for M1023). For
all but the thumbwheel multiplexer port M-variables, the low 16 bits of this code contains the address of the register pointed
to by the M-variable (the high 8 bits tell what part of the address is used and how it is interpreted).
Format Address
0 0 0 0 0 0
If another M-variable points to this part of the definition, it can be used to change the subject register. The main use of this
technique is to create arrays of P- and Q-variables or arrays in dual-ported RAM or in user buffers (see on-line command
DEFINE UBUFFER).
Many M-variables have a more limited range than PMAC's full computational range. If a value outside of the range of an
M-variable is attempted to be placed to that M-variable, PMAC automatically "rolls over" the value to within that range and
does not report any errors. For example, with a single bit M-variable, any odd number written to the variable ends up as "1",
any even number ends up as "0". If a non-integer value is attempted to be placed in an integer M-variable, PMAC
automatically rounds to the nearest integer.
Once defined, an M-variable may be used in programs just as any other variable -- through expressions. When the
expression is evaluated, PMAC reads the defined memory location, calculates a value based on the defined size and format,
and utilizes it in the expression.
Care should be exercised in using M-variables in expressions. If an M-variable is something that can be changed by a servo
routine (such as instantaneous commanded position), which operates at a higher priority the background expression
evaluation, there is no guarantee that the value will not change in the middle of the evaluation. For instance, if in the
expression (M16- M17)*(M16+M17) the M-variables are instantaneous servo variables, the user cannot be sure that M16 or
M17 will have the same value both places in the expression, or that the values for M16 and M17 will come from the same
servo cycle. The first problem can be overcome by setting P1=M16 and P2=M17 right above this, but there is no general
solution to the second problem.
4.3.5 - Array capabilities
XY
$0000
$FFFF
Specified by
assignment
PMAC’s memory