Reference Manual

PMAC 2 Software Reference
PMAC Program Command Specification 329
See Also
How PMAC Executes a Motion Program, Synchronous Variable Assignment (Writing a
Motion Program)
Program Commands I{constant}=, P{constant}=, Q{constant}=,
M{constant}=.
M{constant}&={expression}
Function
M-Variable And-Equals Assignment
Type
Motion program (PROG and ROT)
Syntax
M{constant}&={expression}
where:
{constant} is an integer constant from 0 to 1023 representing the number of the
M-variable.
{expression} is a mathematical expression representing the value to be
‘ANDed’ with this M-variable.
Remarks
This command is equivalent to M{constant}=M{constant}&{expression},
except that the bit-by-bit AND and the assignment of the resulting value to the M-
variable do not happen until the start of the actual execution of the following motion
command. The expression itself is evaluated when the program line is encountered, as in
a non-synchronous statement.
Note:
This command may not be used with any of the thumbwheel-multiplexer
forms of M-variables (TWB, TWD, TWR, or TWS), or with any of the
double-word forms (L, D, or F).
Remember that if you use this M-variable in further expressions before
the next move in the program is started, you will not get the value
assigned in this statement.
Example
M20&=$FE ; Mask out LSB of byte M20
M346&=2 ; Clear all bits except bit 1
See Also
How PMAC Executes a Motion Program, Synchronous Variable Assignment (Writing a
Motion Program)
Program Commands M{constant}=, M{constant}==, M{constant}|=,
M{constant}^=
M{constant}|={expression}
Function
M Variable Or-Equals Assignment
Type
Motion program (PROG and ROT)
Syntax
M{constant}|={expression}
where:
{constant} is an integer constant from 0 to 1023 representing the number of the
M-variable;
{expression} is a mathematical expression representing the value to be ‘ORed’
with this M-variable.
Remarks
This form is equivalent to M{constant}=M{constant}|{expression}, except
that the bit-by-bit OR and the assignment of the resulting value to the M-variable do not
happen until the start of the following servo command. The expression itself is evaluated
when the program line is encountered, as in a non-synchronous statement.