Reference Manual

Turbo PMAC/PMAC2 Software Reference
Turbo PMAC On-line Command Specification 352
47
See Also:
M-Variables (Computational Features)
On-line commands M{data}={expression}, M{constant}->
Program commands M{data}, M{data}={expression}
M{data}={expression}
Function: Assign value to M-variables.
Scope: Global
Syntax: M{data}={expression}
where:
{data} is a constant, or an expression in parentheses, for an integer value from 0 to 8191
representing the M-variable number;
{expression} contains the value to be given to the specified M-variable
M{constant}..{constant}={constant}
where:
the first {constant} is an integer from 0 to 8190 representing the number of the first M-variable;
the second {constant} is an integer from 1 to 8191 representing the number of the last M-
variable; it must be at least as great as the first {constant}
the final {constant} contains the value to be given to the specified range of M-variables
M{constant},{constant},{constant}={constant}
where:
the first {constant} is an integer from 0 to 8190 representing the number of the first M-variable;
the second {constant} is an integer from 1 to 8191 representing the number M-variables whose
value is to be set;
the third {constant} is an integer from 1 to 8191 representing the numerical spacing between each
M-variable whose value is to be set;
the final {constant} contains the value to be given to the specified set of M-variables
This command assigns the value on the right side of the equals sign to the specified M-variables. It does
not assign a definition (address) to the M-variables; that is done with the M{constant}-
>{definition} command.
If a motion or PLC program buffer is open when the single-variable form of this command is sent to
Turbo PMAC, the command will be entered into the buffer for later execution. If a motion or PLC
program buffer is open when the multiple-variable form of this command is sent, Turbo PMAC will reject
the command with an error, reporting ERR003 if I6 is 1 or 3.
Example:
M1=1
M9=M9 & $20
M102=-16384
M1..8=0
M1,16,2=1 ; Sets M1, M3, M5 … , M31 to 1
See Also:
M-Variables (Computational Features)
On-line commands M{constant}, M{constant}->{definition}
Program commands M{data}, M{data}={expression}
M{constant}->
Function: Report current M-variable definitions